aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-01-07 13:09:35 -0800
committerJunio C Hamano <gitster@pobox.com>2015-01-07 13:09:35 -0800
commit487b17de3ea1842b91a739cf31a08130faa03856 (patch)
tree8ed3582f2ab4003c6b01d2d75a3e9a852e80d95f /contrib
parent7938918e9ff4eb481c4bbe9132b26475da65069a (diff)
parenteb443e3b39482b3d64c1efd46de7481c3321a87a (diff)
downloadgit-487b17de3ea1842b91a739cf31a08130faa03856.tar.gz
git-487b17de3ea1842b91a739cf31a08130faa03856.tar.xz
Merge branch 'tf/prompt-preserve-exit-status'
Using the exit status of the last command in the prompt, e.g. PS1='$(__git_ps1) $? ', did not work well because the helper function stomped on the exit status. * tf/prompt-preserve-exit-status: git-prompt: preserve value of $? inside shell prompt
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-prompt.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 729f76947..3c3fc6d5d 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -288,6 +288,7 @@ __git_eread ()
# In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
__git_ps1 ()
{
+ local exit=$?
local pcmode=no
local detached=no
local ps1pc_start='\u@\h:\w '
@@ -511,4 +512,7 @@ __git_ps1 ()
else
printf -- "$printf_format" "$gitstring"
fi
+
+ # preserve exit status
+ return $exit
}