mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Fix automatic detection when git is not installed
subprocess2.check_output() raises an OSError instead of a CalledProcessError when the executable is not found. R=dpranke@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/8511025 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@109325 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@@ -459,6 +459,9 @@ def GuessVCS(options, path, file_list):
|
||||
['git', 'rev-parse', '--is-inside-work-tree'], cwd=real_path,
|
||||
stderr=subprocess2.VOID)
|
||||
return GIT(options, path, file_list)
|
||||
except OSError, e:
|
||||
if e.errno != errno.ENOENT:
|
||||
raise
|
||||
except subprocess2.CalledProcessError, e:
|
||||
if e.returncode != errno.ENOENT and e.returncode != 128:
|
||||
# ENOENT == 2 = they don't have git installed.
|
||||
|
||||
Reference in New Issue
Block a user