Fix git_version on macOS (#24163)
This commit is contained in:
parent
9f8e40e95c
commit
7449d6950a
1 changed files with 3 additions and 2 deletions
|
@ -780,8 +780,9 @@ def __init__(self, **kwargs):
|
|||
|
||||
@property
|
||||
def git_version(self):
|
||||
vstring = self.git('--version', output=str).lstrip('git version ')
|
||||
return Version(vstring)
|
||||
output = self.git('--version', output=str, error=str)
|
||||
match = re.search(r'git version (\S+)', output)
|
||||
return Version(match.group(1)) if match else None
|
||||
|
||||
@property
|
||||
def git(self):
|
||||
|
|
Loading…
Reference in a new issue