From 2bc7f5cb3af981d673b44ce9a1ff5a272535def6 Mon Sep 17 00:00:00 2001 From: Chad Jones Date: Thu, 28 Jun 2012 13:12:13 -0700 Subject: [PATCH] Fix bug in version_tuple to handle strings with -rc# Example of version string that caused a problem: git version 1.7.11-rc3 Change-Id: I8a68b6b37f7b2ded23a1f8ae0d12131050a8807b CC: sop@google.com --- git_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_command.py b/git_command.py index 9bed799e..5988cc28 100644 --- a/git_command.py +++ b/git_command.py @@ -89,7 +89,7 @@ class _GitCall(object): if ver_str.startswith('git version '): _git_version = tuple( map(lambda x: int(x), - ver_str[len('git version '):].strip().split('.')[0:3] + ver_str[len('git version '):].strip().split('-')[0].split('.')[0:3] )) else: print >>sys.stderr, 'fatal: "%s" unsupported' % ver_str