Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: gclient_scm.py

Issue 518064: Check for the existence of git before running commands (Closed)
Patch Set: Fixed whitespace issues Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« gclient ('K') | « gclient ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 6986bb7eb4bbdea5282e529427cf6925e669dc8d..93f69974b83db0e4a10c0e9340c5ca2e4679734d 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -286,8 +286,13 @@ class GitWrapper(SCMWrapper, scm.GIT):
cwd = self.checkout_path
cmd = [self.COMMAND]
cmd.extend(args)
- sp = subprocess.Popen(cmd, cwd=cwd, stdout=stdout)
- output = sp.communicate()[0]
+ logging.debug(cmd)
+ try:
+ sp = subprocess.Popen(cmd, cwd=cwd, stdout=stdout)
+ output = sp.communicate()[0]
+ except OSError:
+ raise gclient_utils.Error("git command '%s' failed to run." %
+ ' '.join(cmd) + "\nCheck that you have git installed.")
if checkrc and sp.returncode:
raise gclient_utils.Error('git command %s returned %d' %
(args[0], sp.returncode))
« gclient ('K') | « gclient ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698