mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
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
This commit is contained in:
parent
303a82f33a
commit
c46de6932a
@ -80,13 +80,13 @@ class _GitCall(object):
|
||||
def version(self):
|
||||
p = GitCommand(None, ['--version'], capture_stdout=True)
|
||||
if p.Wait() == 0:
|
||||
return p.stdout
|
||||
return p.stdout.decode('utf-8')
|
||||
return None
|
||||
|
||||
def version_tuple(self):
|
||||
global _git_version
|
||||
if _git_version is None:
|
||||
ver_str = git.version().decode('utf-8')
|
||||
ver_str = git.version()
|
||||
_git_version = Wrapper().ParseGitVersion(ver_str)
|
||||
if _git_version is None:
|
||||
print('fatal: "%s" unsupported' % ver_str, file=sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user