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

Unified Diff: scm.py

Issue 1652007: gclient_scm.py: Make working with git more reliable (Closed)
Patch Set: Incorporated feedback and rebased against HEAD Created 10 years, 8 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
Index: scm.py
diff --git a/scm.py b/scm.py
index 038d2dd4719a5ad777c383e6a83fc346eae9a9da..bd11394565b1e927f934a310de6ae67550521e3b 100644
--- a/scm.py
+++ b/scm.py
@@ -65,12 +65,16 @@ class GIT(object):
raise
@staticmethod
- def CaptureStatus(files, upstream_branch='origin'):
+ def CaptureStatus(files, upstream_branch=None):
"""Returns git status.
@files can be a string (one file) or a list of files.
Returns an array of (status, file) tuples."""
+ if upstream_branch is None:
+ upstream_branch = GIT.GetUpstreamBranch(os.getcwd())
+ if upstream_branch is None:
+ raise Exception("Cannot determine upstream branch")
command = ["diff", "--name-status", "-r", "%s..." % upstream_branch]
if not files:
pass
« no previous file with comments | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | tests/gclient_scm_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698