From 69995f4984821ffaa2d3be2beceaea37c0b5e9c9 Mon Sep 17 00:00:00 2001 From: "agable@chromium.org" Date: Fri, 25 Apr 2014 21:43:29 +0000 Subject: [PATCH] Fix gclient to correctly check out remote refs during update. Currently, any bot run with "--revision=project@origin/master" fails, because it fetches the remote ref into refs/remotes/origin/master, but then checks out refs/heads/master, which hasn't been rolled forward. This is very similar to the bug fixed by https://codereview.chromium.org/85473007 However, I am very wary of this patch, because I am worried about changing something commented with " For compatibility...". Marc-Antoine, please comment. R=maruel@chromium.org, smut@chromium.org, stip@chromium.org Review URL: https://codereview.chromium.org/244253007 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@266251 0039d316-1c4b-4281-b951-d872f2087c98 --- gclient_scm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gclient_scm.py b/gclient_scm.py index aef296964..e0140515f 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -342,8 +342,8 @@ class GitWrapper(SCMWrapper): if revision.startswith('refs/'): rev_type = "branch" elif revision.startswith(self.remote + '/'): - # For compatibility with old naming, translate 'origin' to 'refs/heads' - revision = revision.replace(self.remote + '/', 'refs/heads/') + # Rewrite remote refs to their local equivalents. + revision = 'refs/remotes/' + revision rev_type = "branch" else: # hash is also a tag, only make a distinction at checkout