From f5faf229d548f8ee2e71d013885c729a4e21f5d5 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Fri, 11 Oct 2024 12:33:33 +1300 Subject: [PATCH] Fix GIT_COMMIT_STATUS check in git_commit_prompt --- fish/conf.d/git_commit_prompt.fish | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fish/conf.d/git_commit_prompt.fish b/fish/conf.d/git_commit_prompt.fish index 628274c..ab308b1 100644 --- a/fish/conf.d/git_commit_prompt.fish +++ b/fish/conf.d/git_commit_prompt.fish @@ -62,10 +62,11 @@ function git_commit_prompt echo "$commit_msg" >"/tmp/.git_commit_message~" eval $argv # run any prequisite commands - echo "$commit_msg" | git commit -F - | tail -n +2 + set -l git_commit_output (echo "$commit_msg" | git commit -F -) + set -l GIT_COMMIT_STATUS $status + echo "$git_commit_output" | tail -n +2 - set GIT_PIPE_STATUS $status - if test "$GIT_PIPE_STATUS" -eq 0 + if test "$GIT_COMMIT_STATUS" -eq 0 # Delete saved commit message if commit was successful /bin/rm -f "/tmp/.git_commit_message~" end