Fix git not found error on Windows when running gclient (#728)
It happens if `git` is not installed as a standard alone application, but as a shell command. Fixes #724.
This commit is contained in:
parent
c576814d30
commit
28537034e8
|
@ -32,8 +32,8 @@ if 'check_output' not in dir(subprocess):
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
version_tag = subprocess.check_output(
|
version_tag = subprocess.check_output(
|
||||||
['git', 'tag', '--points-at', 'HEAD'],
|
'git tag --points-at HEAD',
|
||||||
stderr=subprocess.STDOUT).rstrip()
|
stderr=subprocess.STDOUT, shell=True).rstrip()
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
# git tag --points-at is not supported in old versions of git. Just ignore
|
# git tag --points-at is not supported in old versions of git. Just ignore
|
||||||
# version_tag in this case.
|
# version_tag in this case.
|
||||||
|
@ -41,8 +41,8 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
try:
|
try:
|
||||||
version_hash = subprocess.check_output(
|
version_hash = subprocess.check_output(
|
||||||
['git', 'rev-parse', '--short', 'HEAD'],
|
'git rev-parse --short HEAD',
|
||||||
stderr=subprocess.STDOUT).rstrip()
|
stderr=subprocess.STDOUT, shell=True).rstrip()
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
version_hash = 'unknown-version'
|
version_hash = 'unknown-version'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue