Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 8a4e6c7

Browse files
committed
fix: Resolve issue with success message at failure
Recognises when a non-zero result was returned from commit command. No longer shows 'success' message. Fix #36
1 parent 72d8f94 commit 8a4e6c7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gitcommit/gitcommit.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,11 @@ def run():
382382
if confirm in confirmation_validator.confirmations:
383383
print()
384384
cmds = ["git", "commit", "-m", commit_msg] + argv_passthrough
385-
subprocess.call(cmds)
386-
Ansi.print_ok("\nCommit has been made to conventional commits standards!")
385+
returncode = subprocess.run(cmds).returncode
386+
if returncode == 0:
387+
Ansi.print_ok("\nCommit has been made to conventional commits standards!")
388+
else:
389+
Ansi.print_error("\nThere was an error whilst attempting the commit!")
387390

388391
elif confirm in confirmation_validator.rejections:
389392
print("Aborting the commit...")

0 commit comments

Comments
 (0)