Commit 92745a5b authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

bot_update: Fix syncing to origin/*.

Skip adding origin if the branch name already has 'origin/'.

Bug: 859703
Change-Id: I0141c04189d00187c202a7885a7c6bb74571e7ea
Reviewed-on: https://chromium-review.googlesource.com/1128390Reviewed-by: 's avatarVadim Shtayura <vadimsh@chromium.org>
Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
parent 4fb2477d
......@@ -579,7 +579,10 @@ def force_solution_revision(solution_name, git_url, revisions, cwd):
# This will also not work if somebody passes a local refspec like
# refs/heads/master. It needs to translate to refs/remotes/origin/master
# first. See also https://crbug.com/740456 .
treeish = branch if branch.startswith('refs/') else 'origin/%s' % branch
if branch.startswith(('refs/', 'origin/')):
treeish = branch
else:
treeish = 'origin/' + branch
# Note that -- argument is necessary to ensure that git treats `treeish`
# argument as revision or ref, and not as a file/directory which happens to
......
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