Skip to content

Commit 609237d

Browse files
author
bernat
committed
Correctly parses git --version. Closes: #722481.
git-svn-id: svn+ssh://svn.debian.org/svn/python-modules/packages/python-git/trunk@26361 771dd761-d7fa-0310-a302-f036d1c1ebb6
1 parent 898307f commit 609237d

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

debian/changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ python-git (0.3.2~RC1-3) UNRELEASED; urgency=low
22

33
* Update Homepage to a working URL.
44
* Bump Standards-Version to 3.9.5.
5+
* Correctly parses `git --version` when not all components are
6+
numeric. Closes: #722481.
57

68
-- Vincent Bernat <[email protected]> Sat, 02 Nov 2013 01:27:18 +0100
79

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

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dont-choke-on-rc-version.patch

0 commit comments

Comments
 (0)