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

Unified Diff: gclient_scm.py

Issue 474002: Fix default cwd value and the timing of the result code check (Closed)
Patch Set: Created 11 years 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
« no previous file with comments | « no previous file | 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 d36a95bb4e1918db3af4f3819503b8b63f40ff29..034dc2df6c8bdef41dc7f8460bc8ca356036756a 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -187,6 +187,8 @@ class GitWrapper(SCMWrapper, scm.GIT):
def _Run(self, args, cwd=None, checkrc=True, redirect_stdout=True):
# TODO(maruel): Merge with Capture?
+ if cwd is None:
+ cwd = self.checkout_path
stdout=None
if redirect_stdout:
stdout=subprocess.PIPE
@@ -195,10 +197,10 @@ class GitWrapper(SCMWrapper, scm.GIT):
cmd = [self.COMMAND]
cmd.extend(args)
sp = subprocess.Popen(cmd, cwd=cwd, stdout=stdout)
+ output = sp.communicate()[0]
if checkrc and sp.returncode:
raise gclient_utils.Error('git command %s returned %d' %
(args[0], sp.returncode))
- output = sp.communicate()[0]
if output is not None:
return output.strip()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698