Commit 83376f2f authored by msb@chromium.org's avatar msb@chromium.org

gclient: fix git version check to handle 1.6.5.2.5.g7c3ba.dirty

Review URL: http://codereview.chromium.org/486036

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@34386 0039d316-1c4b-4281-b951-d872f2087c98
parent 923a0373
......@@ -115,7 +115,7 @@ class GitWrapper(SCMWrapper, scm.GIT):
if args:
raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args))
self._CheckMinVersion("1.6.1")
self._CheckMinVersion("1.6")
url, revision = gclient_utils.SplitUrlRevision(self.url)
rev_str = ""
......@@ -188,8 +188,13 @@ class GitWrapper(SCMWrapper, scm.GIT):
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
def _CheckMinVersion(self, min_version):
def only_int(val):
if val.isdigit():
return int(val)
else:
return 0
version = self._Run(['--version']).split()[-1]
version_list = map(int, version.split('.'))
version_list = map(only_int, version.split('.'))
min_version_list = map(int, min_version.split('.'))
for min_ver in min_version_list:
ver = version_list.pop(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment