Commit 813ec3c3 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

git cl land + gnumbd: add asserts.

BUG=642493

Change-Id: Ib1234922e4bcd4ee286fffb8f7c637e4d2442a42
Reviewed-on: https://chromium-review.googlesource.com/414504
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
parent 06a2502f
......@@ -4441,6 +4441,16 @@ def SendUpstream(parser, args, cmd):
if not pending_prefix or branch.startswith(pending_prefix):
# If not using refs/pending/heads/* at all, or target ref is already set
# to pending, then push to the target ref directly.
# NB(tandrii): I think branch.startswith(pending_prefix) never happens
# in practise. I really tried to create a new branch tracking
# refs/pending/heads/master directly and git cl land failed long before
# reaching this. Disagree? Comment on http://crbug.com/642493.
if pending_prefix:
print('\n\nYOU GOT A CHANCE TO WIN A FREE GIFT!\n\n'
'Grab your .git/config, add instructions how to reproduce '
'this, and post it to http://crbug.com/642493.\n'
'The first reporter gets a free "Black Swan" book from '
'tandrii@\n\n')
retcode, output = RunGitWithCode(
['push', '--porcelain', pushurl, 'HEAD:%s' % branch])
pushed_to_pending = pending_prefix and branch.startswith(pending_prefix)
......
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