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: Sergiy Byelozyorov <sergiyb@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 3e79021..51d867d 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -4441,6 +4441,16 @@
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)