Skip to content

Commit c3b7263

Browse files
committed
git.version_info now returns exactly 4 numbers
1 parent 59879a4 commit c3b7263

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git/cmd.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,9 @@ def __getattr__(self, name):
223223

224224
def _set_cache_(self, attr):
225225
if attr == '_version_info':
226+
# We only use the first 4 numbers, as everthing else could be strings in fact (on windows)
226227
version_numbers = self._call_process('version').rpartition(' ')[2]
227-
self._version_info = tuple(int(n) for n in version_numbers.split('.'))
228+
self._version_info = tuple(int(n) for n in version_numbers.split('.')[:4])
228229
else:
229230
super(Git, self)._set_cache_(attr)
230231
#END handle version info
@@ -238,7 +239,7 @@ def working_dir(self):
238239
@property
239240
def version_info(self):
240241
"""
241-
:return: tuple(int, ...) tuple with integers representing the major, minor
242+
:return: tuple(int, int, int, int) tuple with integers representing the major, minor
242243
and additional version numbers as parsed from git version.
243244
This value is generated on demand and is cached"""
244245
return self._version_info

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy