aboutsummaryrefslogtreecommitdiff
path: root/bdep/git.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-08-06 22:15:05 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-08-07 15:14:44 +0300
commit4f2d4022dca65da2a6f03e1f27df13deeaab360a (patch)
tree7fe826041792c7e51792283f28ee29c1744e04f9 /bdep/git.hxx
parent228a2dfec33eb9ba966894bd23c2f4db51a7e330 (diff)
Add git version check (2.12 is minimum supported)
Diffstat (limited to 'bdep/git.hxx')
-rw-r--r--bdep/git.hxx32
1 files changed, 21 insertions, 11 deletions
diff --git a/bdep/git.hxx b/bdep/git.hxx
index 1552670..ca49622 100644
--- a/bdep/git.hxx
+++ b/bdep/git.hxx
@@ -5,39 +5,49 @@
#ifndef BDEP_GIT_HXX
#define BDEP_GIT_HXX
+#include <libbutl/git.mxx>
+
#include <bdep/types.hxx>
#include <bdep/utility.hxx>
namespace bdep
{
- // Return true if the specified directory is a git repository root (contains
- // the .git filesystem entry).
- //
- bool
- git (const dir_path&);
+ using butl::git_repository;
- template <typename... A>
- inline void
- run_git (const dir_path& repo, A&&... args);
+ template <typename I, typename O, typename E, typename... A>
+ process
+ start_git (I&& in, O&& out, E&& err, A&&... args);
template <typename I, typename O, typename E, typename... A>
- inline process
- start_git (I&& in, O&& out, E&& err, const dir_path& repo, A&&... args);
+ process
+ start_git (const dir_path& repo, I&& in, O&& out, E&& err, A&&... args);
+
+ void
+ finish_git (process& pr, bool io_read = false);
+
+ template <typename... A>
+ void
+ run_git (const dir_path& repo, A&&... args);
// Return the first line of the git output. If ignore_error is true, then
// suppress stderr, ignore (normal) error exit status, and return nullopt.
//
template <typename... A>
optional<string>
+ git_line (bool ignore_error, A&&... args);
+
+ template <typename... A>
+ optional<string>
git_line (const dir_path& repo, bool ignore_error, A&&... args);
// Similar to the above but takes the already started git process with a
// redirected output pipe.
//
optional<string>
- git_line (process&& pr, fdpipe&& pipe, bool ignore_error = false);
+ git_line (process&& pr, fdpipe&& pipe, bool ignore_error);
}
#include <bdep/git.ixx>
+#include <bdep/git.txx>
#endif // BDEP_GIT_HXX