1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Author: "Marcus R. Brown" <mrbrown@precision-mojo.com>
Description: Fix the `git version` parser to not choke on stuff like
'1.8.4.rc3'.
Origin: https://github.com/gitpython-developers/GitPython/pull/88
Bug-Debian: http://bugs.debian.org/722481
diff --git a/git/cmd.py b/git/cmd.py
index 576a530..6bd7901 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -234,7 +234,7 @@ def _set_cache_(self, attr):
if attr == '_version_info':
# We only use the first 4 numbers, as everthing else could be strings in fact (on windows)
version_numbers = self._call_process('version').split(' ')[2]
- self._version_info = tuple(int(n) for n in version_numbers.split('.')[:4])
+ self._version_info = tuple(int(n) for n in version_numbers.split('.')[:4] if n.isdigit())
else:
super(Git, self)._set_cache_(attr)
#END handle version info
--
1.8.4
|