git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-prompt: preserve command exit status
@ 2014-12-22 14:30 Tony Finch
  2014-12-22 17:19 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Tony Finch @ 2014-12-22 14:30 UTC (permalink / raw)
  To: git

Signed-off-by: Tony Finch <dot@dotat.at>
---
 contrib/completion/git-prompt.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index c5473dc..5fe69d0 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
 }
-- 
2.1.0.rc1.12.g1e9b79d

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-01-14 12:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-22 14:30 [PATCH] git-prompt: preserve command exit status Tony Finch
2014-12-22 17:19 ` Junio C Hamano
2014-12-22 18:09   ` [PATCH v2] git-prompt: preserve value of $? inside shell prompt Tony Finch
2014-12-22 19:58     ` Junio C Hamano
2014-12-22 22:18       ` Tony Finch
2015-01-13 23:57     ` SZEDER Gábor
2015-01-14 10:05       ` Tony Finch
2015-01-14 10:06       ` [PATCH] git-prompt: preserve value of $? in all cases Tony Finch
2015-01-14 12:10         ` SZEDER Gábor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).