From f7b584178a56a3d56300d71d964627c0e63b8cd6 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Thu, 31 Aug 2023 10:56:05 +0200 Subject: [PATCH] fix: empty error on bump failure 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 " ``` --- commitizen/commands/bump.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commitizen/commands/bump.py b/commitizen/commands/bump.py index 8e6701414..b515435d1 100644 --- a/commitizen/commands/bump.py +++ b/commitizen/commands/bump.py @@ -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: