From 39e7da8a375b999eba255800a20d406b70090cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E7=95=85?= <631866165@qq.com> Date: Thu, 6 Aug 2020 11:43:12 +0800 Subject: [PATCH] fix(push): check CurrentBranch --- subcmds/push.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subcmds/push.py b/subcmds/push.py index c479c92..ec317dc 100644 --- a/subcmds/push.py +++ b/subcmds/push.py @@ -345,9 +345,10 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ if (not opt.new_branch and project.GetUploadableBranch(project.CurrentBranch) is None): continue - branch = project.GetBranch(project.CurrentBranch) - rb = ReviewableBranch(project, branch, branch.LocalMerge) - pending.append((project, [rb])) + if project.CurrentBranch: + branch = project.GetBranch(project.CurrentBranch) + rb = ReviewableBranch(project, branch, branch.LocalMerge) + pending.append((project, [rb])) if opt.reviewers: reviewers = _SplitUsers(opt.reviewers)