Skip to content

Commit

Permalink
Improve error message in case no remote branch is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Scheirle committed Mar 7, 2024
1 parent ecf7828 commit 4045e1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions git_gerrit/cli/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ def main(self):
if b is None:
print("Current branch not known, no branch checked out?")
return 1
if b.remote_name == "":
print("Current branch has no remote, cannot push to gerrit")
return 1
cmd = ["push", GitConfig.remote(), f"HEAD:refs/for/{b.remote_name}", "-o", f"hashtag=branch:{b.local_name}"] + self.options
git[cmd].run_fg()

0 comments on commit 4045e1d

Please sign in to comment.