Commit 69995f49 authored by agable@chromium.org's avatar agable@chromium.org

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
parent a4c03054
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment