summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Tony Finch <dot@dotat.at>2014-12-22 18:09:25 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-12-22 11:58:56 -0800
commiteb443e3b39482b3d64c1efd46de7481c3321a87a (patch)
treee188f042bdcf11e590d26edc018059363d365ec2 /builtin
parentclean: typofix (diff)
downloadtgif-eb443e3b39482b3d64c1efd46de7481c3321a87a.tar.xz
git-prompt: preserve value of $? inside shell prompt
If you have a prompt which displays the command exit status, __git_ps1 without this change corrupts it, although it has the correct value in the parent shell: ~/src/git (master) 0 $ set | grep ^PS1 PS1='\w$(__git_ps1) $? \$ ' ~/src/git (master) 0 $ false ~/src/git (master) 0 $ echo $? 1 ~/src/git (master) 0 $ There is a slightly ugly workaround: ~/src/git (master) 0 $ set | grep ^PS1 PS1='\w$(x=$?; __git_ps1; exit $x) $? \$ ' ~/src/git (master) 0 $ false ~/src/git (master) 1 $ This change makes the workaround unnecessary. Signed-off-by: Tony Finch <dot@dotat.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
0 files changed, 0 insertions, 0 deletions