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