[PATCH] git-gui: do not exit upon prepare-commit-msg hook failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



prepare-commit-msg hook is fired as soon git-gui is started
and upon F5 in order to pre-fill commit message area.

Having it fatal, forcibly exiting app when this hook fails
rendered git-gui unusable in this case. Fix this by not
treating this hook as fatal, and not exiting app when failure
popup is dismissed.

This way, user can use git-gui when he/she dismisses failure popup
of a failed prepare-commit-msg hook.

Note that this commit does not deny user from commiting when
prepare-commit-msg failed. Message is simply not pre-filled.

Signed-off-by: Anthony Loiseau <anthony@xxxxxxxxxx>
---
 git-gui/git-gui.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 8fe7538e72..ab6caaf2ae 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1643,9 +1643,8 @@ proc prepare_commit_msg_hook_wait {fd_ph} {
 	if {[eof $fd_ph]} {
 		if {[catch {close $fd_ph}]} {
 			ui_status [mc "Commit declined by prepare-commit-msg hook."]
-			hook_failed_popup prepare-commit-msg $pch_error
+			hook_failed_popup prepare-commit-msg $pch_error 0
 			catch {file delete [gitdir PREPARE_COMMIT_MSG]}
-			exit 1
 		} else {
 			load_message PREPARE_COMMIT_MSG
 		}
-- 
2.45.2





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux