diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-06-07 23:39:53 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-06-07 23:39:53 +0200 |
commit | c3b7263e0bb9cc1d94e483e66c1494e0e7982fd1 (patch) | |
tree | d06a030bb4fc9541941ee53af9a1d01c7da8a960 /git/cmd.py | |
parent | 59879a4e1e2c39e41fa552d8ac0d547c62936897 (diff) | |
download | gitpython-c3b7263e0bb9cc1d94e483e66c1494e0e7982fd1.tar.gz |
git.version_info now returns exactly 4 numbers
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -223,8 +223,9 @@ class Git(LazyMixin): 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').rpartition(' ')[2] - self._version_info = tuple(int(n) for n in version_numbers.split('.')) + self._version_info = tuple(int(n) for n in version_numbers.split('.')[:4]) else: super(Git, self)._set_cache_(attr) #END handle version info @@ -238,7 +239,7 @@ class Git(LazyMixin): @property def version_info(self): """ - :return: tuple(int, ...) tuple with integers representing the major, minor + :return: tuple(int, int, int, int) tuple with integers representing the major, minor and additional version numbers as parsed from git version. This value is generated on demand and is cached""" return self._version_info |