mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
gclient: fix gclient sync with revision ref
Check /refs/heads/ strictly as branch revision type. Any ref (e.g. /refs/changes/*) not a branch has no difference from a hash. Bug:341208163 Change-Id: I23e8c577b099adb88917527f827da3b122997cb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5835142 Commit-Queue: Chenlin Fan <fancl@chromium.org> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
@@ -761,12 +761,14 @@ class GitWrapper(SCMWrapper):
|
||||
# Rewrite remote refs to their local equivalents.
|
||||
revision = ''.join(remote_ref)
|
||||
rev_type = "branch"
|
||||
elif revision.startswith('refs/'):
|
||||
elif revision.startswith('refs/heads/'):
|
||||
# Local branch? We probably don't want to support, since DEPS should
|
||||
# always specify branches as they are in the upstream repo.
|
||||
rev_type = "branch"
|
||||
else:
|
||||
# hash is also a tag, only make a distinction at checkout
|
||||
# hash is also a tag, only make a distinction at checkout.
|
||||
# Any ref (e.g. /refs/changes/*) not a branch has no difference from
|
||||
# a hash.
|
||||
rev_type = "hash"
|
||||
|
||||
# If we are going to introduce a new project, there is a possibility
|
||||
|
||||
Reference in New Issue
Block a user