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/1128390
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
changes/90/1128390/2
Edward Lemur 8 years ago committed by Commit Bot
parent 4fb2477d08
commit 92745a5b0e

@ -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

Loading…
Cancel
Save