diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-06-07 23:39:53 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-06-08 01:36:37 +0200 |
commit | 24bc8414a8d3fc74dc643581a60c663718c1deee (patch) | |
tree | 119b60a8e99d6e260add3af82d1f1e9bb617cf7f /git/cmd.py | |
parent | 90e780a3e16d0c3e4d7288728f6ba36e9c18d736 (diff) | |
download | gitpython-24bc8414a8d3fc74dc643581a60c663718c1deee.tar.gz |
git.version_info now returns exactly 4 numbers
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 6 |
1 files changed, 4 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 @@ -237,7 +238,8 @@ 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 |