From fbd3f2a10bf4ddd1f001543c6262c6866a84f0a1 Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Tue, 15 Oct 2013 12:59:00 -0700 Subject: [PATCH] Only check merge destination if it isn't None Change-Id: Ifb1dcd07142933489e93a1f4f03e38289087b609 --- subcmds/upload.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/subcmds/upload.py b/subcmds/upload.py index 7d460ddf..7f7585ae 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -349,15 +349,16 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ # Make sure our local branch is not setup to track a different remote branch merge_branch = self._GetMergeBranch(branch.project) - full_dest = 'refs/heads/%s' % destination - if not opt.dest_branch and merge_branch and merge_branch != full_dest: - print('merge branch %s does not match destination branch %s' - % (merge_branch, full_dest)) - print('skipping upload.') - print('Please use `--destination %s` if this is intentional' - % destination) - branch.uploaded = False - continue + if destination: + full_dest = 'refs/heads/%s' % destination + if not opt.dest_branch and merge_branch and merge_branch != full_dest: + print('merge branch %s does not match destination branch %s' + % (merge_branch, full_dest)) + print('skipping upload.') + print('Please use `--destination %s` if this is intentional' + % destination) + branch.uploaded = False + continue branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft, dest_branch=destination) branch.uploaded = True