summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChirayu Desai <chirayudesai1@gmail.com>2014-08-20 09:34:10 +0530
committerChirayu Desai <chirayudesai1@gmail.com>2014-08-20 11:47:10 +0530
commitc46de6932ac95eb6086a24c6880553f27cf5be44 (patch)
tree560f4fd500ecb868b592f314c94f6faabc7d4e0a
parent303a82f33a1360036b6f70864d3099f9d803f2c7 (diff)
downloadgit-repo-c46de6932ac95eb6086a24c6880553f27cf5be44.tar.gz
Decode git version
Used by 'repo --version' With Python 3, * Before: b'git version 2.1.0' * After: git version 2.1.0 Change-Id: I4321bb0f09e92cda1123c35910338b940e82a305
-rw-r--r--git_command.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/git_command.py b/git_command.py
index 354fc715..53b3e75c 100644
--- a/git_command.py
+++ b/git_command.py
@@ -80,13 +80,13 @@ class _GitCall(object):
80 def version(self): 80 def version(self):
81 p = GitCommand(None, ['--version'], capture_stdout=True) 81 p = GitCommand(None, ['--version'], capture_stdout=True)
82 if p.Wait() == 0: 82 if p.Wait() == 0:
83 return p.stdout 83 return p.stdout.decode('utf-8')
84 return None 84 return None
85 85
86 def version_tuple(self): 86 def version_tuple(self):
87 global _git_version 87 global _git_version
88 if _git_version is None: 88 if _git_version is None:
89 ver_str = git.version().decode('utf-8') 89 ver_str = git.version()
90 _git_version = Wrapper().ParseGitVersion(ver_str) 90 _git_version = Wrapper().ParseGitVersion(ver_str)
91 if _git_version is None: 91 if _git_version is None:
92 print('fatal: "%s" unsupported' % ver_str, file=sys.stderr) 92 print('fatal: "%s" unsupported' % ver_str, file=sys.stderr)