Skip to content

Commit

Permalink
fix: empty error on bump failure
Browse files Browse the repository at this point in the history
before:

```
2nd git.commit error: ""
```

after

```
2nd git.commit error: "On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
"
```
  • Loading branch information
carlossg committed Aug 31, 2023
1 parent a4f4029 commit f7b5841
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commitizen/commands/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ def __call__(self): # noqa: C901
cmd.run(git_add_changelog_and_version_files_command)
c = git.commit(message, args=self._get_commit_args())
if c.return_code != 0:
raise BumpCommitFailedError(f'2nd git.commit error: "{c.err.strip()}"')
err = c.err.strip() or c.out
raise BumpCommitFailedError(f'2nd git.commit error: "{err}"')

if c.out:
if self.git_output_to_stderr:
Expand Down

0 comments on commit f7b5841

Please sign in to comment.