prompt: fix untracked files for zsh
We signal presense of untracked files by adding a per-cent sign '%' to the prompt. But because '%' is used as an escape character to introduce prompt customization in zsh (just like bash prompt uses '\' to escape '\u', '\h', etc.), we need to say '%%' to get a literal per-cent. Helped-by: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
845241d544
commit
24b6132e57
@ -338,7 +338,7 @@ __git_ps1 ()
|
|||||||
[ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
|
[ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
|
||||||
[ -n "$(git ls-files --others --exclude-standard)" ]
|
[ -n "$(git ls-files --others --exclude-standard)" ]
|
||||||
then
|
then
|
||||||
u="%"
|
u="%${ZSH_VERSION+%}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
|
if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user