aboutsummaryrefslogtreecommitdiff
path: root/bdep/git.ixx
blob: 2913cc620e482fa2968152c90cac88ea2dd93746 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// file      : bdep/git.ixx -*- C++ -*-
// license   : MIT; see accompanying LICENSE file

namespace bdep
{
  template <typename I, typename O, typename E, typename... A>
  inline process
  start_git (const semantic_version& min_ver,
             bool system,
             const dir_path& repo,
             I&& in, O&& out, E&& err,
             A&&... args)
  {
    return start_git (min_ver,
                      system,
                      forward<I> (in), forward<O> (out), forward<E> (err),
                      "-C", repo,
                      forward<A> (args)...);
  }

  inline void
  finish_git (process& pr, bool io_read)
  {
    finish ("git", pr, io_read);
  }

  template <typename... A>
  inline optional<string>
  git_line (const semantic_version& min_ver,
            bool system,
            const dir_path& repo,
            bool ie,
            A&&... args)
  {
    return git_line (min_ver,
                     system,
                     ie,
                     "-C", repo,
                     forward<A> (args)...);
  }

  template <typename... A>
  inline optional<string>
  git_string (const semantic_version& min_ver,
              bool system,
              const dir_path& repo,
              bool ie,
              A&&... args)
  {
    return git_string (min_ver,
                       system,
                       ie,
                       "-C", repo,
                       forward<A> (args)...);
  }

  inline optional<string>
  git_string (process&& pr, fdpipe&& pipe, bool ignore_error)
  {
    return git_line (move (pr), move (pipe), ignore_error, '\0' /* delim */);
  }
}