Commit 42d8da58 authored by sky@chromium.org's avatar sky@chromium.org

Changes GetSVNBranch to prefer origin/HEAD over all others.

Review URL: http://codereview.chromium.org/1745009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@45468 0039d316-1c4b-4281-b951-d872f2087c98
parent 54c3a7e9
......@@ -172,9 +172,9 @@ class GIT(object):
for ref in remotes:
match = git_svn_re.search(
GIT.Capture(['cat-file', '-p', ref], cwd)[0])
if match and match.group(1) not in svn_refs:
# To prefer local refs over remote ones we only set the first occurence.
# The assumption being local refs are usually first.
# Prefer origin/HEAD over all others.
if match and (match.group(1) not in svn_refs or
ref == "refs/remotes/origin/HEAD"):
svn_refs[match.group(1)] = ref
svn_branch = ''
......
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