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

Unified Diff: scm.py

Issue 554142: Fix a FetchUpstreamTuple cwd bug (Closed)
Patch Set: 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
« 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: scm.py
diff --git a/scm.py b/scm.py
index c47a00c2466847ee0a4483db83aca31ec5a5e5e5..1d15243d4691fb024e1ad12ed9094375e98cbe3d 100644
--- a/scm.py
+++ b/scm.py
@@ -205,20 +205,16 @@ class GIT(object):
branch = GIT.GetBranch(cwd)
upstream_branch = None
upstream_branch = GIT.Capture(
- ['config', 'branch.%s.merge' % branch], error_ok=True).strip()
+ ['config', 'branch.%s.merge' % branch], in_directory=cwd,
+ error_ok=True).strip()
if upstream_branch:
remote = GIT.Capture(
['config', 'branch.%s.remote' % branch],
- error_ok=True).strip()
+ in_directory=cwd, error_ok=True).strip()
else:
# Fall back on trying a git-svn upstream branch.
if GIT.IsGitSvn(cwd):
upstream_branch = GIT.GetSVNBranch(cwd)
- # Fall back on origin/master if it exits.
- if not upstream_branch:
- GIT.Capture(['branch', '-r']).split().count('origin/master')
- remote = 'origin'
- upstream_branch = 'refs/heads/master'
return remote, upstream_branch
@staticmethod
« 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