From 813ec3c322347867424fd93df32fd77ac16f69b7 Mon Sep 17 00:00:00 2001 From: Andrii Shyshkalov Date: Thu, 24 Nov 2016 17:06:01 +0100 Subject: [PATCH] git cl land + gnumbd: add asserts. BUG=642493 Change-Id: Ib1234922e4bcd4ee286fffb8f7c637e4d2442a42 Reviewed-on: https://chromium-review.googlesource.com/414504 Commit-Queue: Andrii Shyshkalov Reviewed-by: Sergiy Byelozyorov --- git_cl.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/git_cl.py b/git_cl.py index 3e790219a..51d867dc0 100755 --- a/git_cl.py +++ b/git_cl.py @@ -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)