Commit 67ec5fae authored by maruel@chromium.org's avatar maruel@chromium.org

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
parent fefff18b
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment