summaryrefslogtreecommitdiffstats
path: root/git_command.py
diff options
context:
space:
mode:
Diffstat (limited to 'git_command.py')
-rw-r--r--git_command.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/git_command.py b/git_command.py
index 51f5e3c0..58fc7518 100644
--- a/git_command.py
+++ b/git_command.py
@@ -88,10 +88,14 @@ class _GitCall(object):
88 if _git_version is None: 88 if _git_version is None:
89 ver_str = git.version().decode('utf-8') 89 ver_str = git.version().decode('utf-8')
90 if ver_str.startswith('git version '): 90 if ver_str.startswith('git version '):
91 _git_version = tuple( 91 num_ver_str = ver_str[len('git version '):].strip()
92 map(int, 92 to_tuple = []
93 ver_str[len('git version '):].strip().split('-')[0].split('.')[0:3] 93 for num_str in num_ver_str.split('.')[:3]:
94 )) 94 if num_str.isdigit():
95 to_tuple.append(int(num_str))
96 else:
97 to_tuple.append(0)
98 _git_version = tuple(to_tuple)
95 else: 99 else:
96 print('fatal: "%s" unsupported' % ver_str, file=sys.stderr) 100 print('fatal: "%s" unsupported' % ver_str, file=sys.stderr)
97 sys.exit(1) 101 sys.exit(1)