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

Unified Diff: git_cl.py

Issue 498013002: Fix git-cl when working on branches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: real fix Created 6 years, 4 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: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 1f4b01b039abdcf58f04786ccd8c8cd4b1e92e1a..01a12a82c816287504037fcbb19ee55047dfab2b 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -581,7 +581,10 @@ or verify this branch is set up to track another (via the --track argument to
if self.upstream_branch is None:
remote, upstream_branch = self.FetchUpstreamTuple(self.GetBranch())
if remote is not '.':
- upstream_branch = upstream_branch.replace('heads', 'remotes/' + remote)
+ upstream_branch = upstream_branch.replace('refs/heads/',
+ 'refs/remotes/%s/' % remote)
+ upstream_branch = upstream_branch.replace('refs/branch-heads/',
+ 'refs/remotes/branch-heads/')
self.upstream_branch = upstream_branch
return self.upstream_branch
@@ -615,6 +618,8 @@ or verify this branch is set up to track another (via the --track argument to
branch = 'HEAD'
if branch.startswith('refs/remotes'):
self._remote = (remote, branch)
+ elif branch.startswith('refs/branch-heads/'):
+ self._remote = (remote, branch.replace('refs/', 'refs/remotes/'))
else:
self._remote = (remote, 'refs/remotes/%s/%s' % (remote, branch))
return self._remote
« 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