aboutsummaryrefslogtreecommitdiff
path: root/bdep/git.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-06-22 15:49:05 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-06-22 19:31:26 +0300
commitc2404728b623588aa89920ae435b48af0fef011e (patch)
treeba739c37837b71dbc8881cad81204ac2ee6f50e4 /bdep/git.hxx
parentf95f24412ea85149556b34abb91f06e247d6db6d (diff)
Add branch sub-option for git project vcs in bdep-new
Also fix tests which failed if for the initial branch git-init defaults to the name other than 'master'.
Diffstat (limited to 'bdep/git.hxx')
-rw-r--r--bdep/git.hxx40
1 files changed, 39 insertions, 1 deletions
diff --git a/bdep/git.hxx b/bdep/git.hxx
index b7703ea..30baf69 100644
--- a/bdep/git.hxx
+++ b/bdep/git.hxx
@@ -67,18 +67,50 @@ namespace bdep
// Run git process.
//
+ // Pass NULL as the repository argument if the git command is not
+ // repository-specific (e.g., init).
+ //
template <typename... A>
void
run_git (const semantic_version&,
bool system,
bool progress,
- const dir_path& repo,
+ const dir_path* repo,
A&&... args);
template <typename... A>
inline void
run_git (const semantic_version& min_ver,
bool system,
+ const dir_path* repo,
+ A&&... args)
+ {
+ run_git (min_ver,
+ system,
+ true /* progress */,
+ repo,
+ forward<A> (args)...);
+ }
+
+ template <typename... A>
+ inline void
+ run_git (const semantic_version& min_ver,
+ bool system,
+ bool progress,
+ const dir_path& repo,
+ A&&... args)
+ {
+ run_git (min_ver,
+ system,
+ progress,
+ &repo,
+ forward<A> (args)...);
+ }
+
+ template <typename... A>
+ inline void
+ run_git (const semantic_version& min_ver,
+ bool system,
const dir_path& repo,
A&&... args)
{
@@ -173,6 +205,12 @@ namespace bdep
template <typename... A>
void
git_push (const common_options&, const dir_path& repo, A&&... args);
+
+ // Return true if git is at least of the specified minimum supported
+ // version.
+ //
+ bool
+ git_try_check_version (const semantic_version&, bool system);
}
#include <bdep/git.ixx>