diff options
Diffstat (limited to 'git_command.py')
-rw-r--r-- | git_command.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/git_command.py b/git_command.py index 1807b55e..54db4d16 100644 --- a/git_command.py +++ b/git_command.py | |||
@@ -80,22 +80,12 @@ def terminate_ssh_clients(): | |||
80 | _git_version = None | 80 | _git_version = None |
81 | 81 | ||
82 | class _GitCall(object): | 82 | class _GitCall(object): |
83 | def version(self): | ||
84 | p = GitCommand(None, ['--version'], capture_stdout=True) | ||
85 | if p.Wait() == 0: | ||
86 | if hasattr(p.stdout, 'decode'): | ||
87 | return p.stdout.decode('utf-8') | ||
88 | else: | ||
89 | return p.stdout | ||
90 | return None | ||
91 | |||
92 | def version_tuple(self): | 83 | def version_tuple(self): |
93 | global _git_version | 84 | global _git_version |
94 | if _git_version is None: | 85 | if _git_version is None: |
95 | ver_str = git.version() | 86 | _git_version = Wrapper().ParseGitVersion() |
96 | _git_version = Wrapper().ParseGitVersion(ver_str) | ||
97 | if _git_version is None: | 87 | if _git_version is None: |
98 | print('fatal: "%s" unsupported' % ver_str, file=sys.stderr) | 88 | print('fatal: unable to detect git version', file=sys.stderr) |
99 | sys.exit(1) | 89 | sys.exit(1) |
100 | return _git_version | 90 | return _git_version |
101 | 91 | ||