From 7a6c15e8ff135fc6b22b09038454d007da9642f4 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 11 Aug 2018 22:25:39 +0300 Subject: Make get-related functions to take minimum supported version as an argument --- bdep/git.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bdep/git.cxx') diff --git a/bdep/git.cxx b/bdep/git.cxx index c0b48fc..79e6255 100644 --- a/bdep/git.cxx +++ b/bdep/git.cxx @@ -5,7 +5,6 @@ #include #include -#include #include @@ -15,8 +14,11 @@ namespace bdep { static optional git_ver; + // On the first call check that git is at least of the specified minimum + // supported version. + // void - git_check_version () + git_check_version (const standard_version& min_ver) { if (!git_ver) { @@ -25,14 +27,16 @@ namespace bdep // git_ver = standard_version (); - optional s (git_line (false /* ignore_error */, "--version")); + optional s (git_line (min_ver, + false /* ignore_error */, + "--version")); if (!s || !(git_ver = git_version (*s))) fail << "unable to obtain git version"; - if (git_ver->version < 20120000000) + if (*git_ver < min_ver) fail << "unsupported git version " << *git_ver << - info << "minimum supported version is 2.12.0" << endf; + info << "minimum supported version is " << min_ver << endf; } } -- cgit v1.1