summaryrefslogtreecommitdiff
path: root/lib/git.zsh
diff options
context:
space:
mode:
authorYuichi Tanikawa <t.yuichi111@gmail.com>2016-09-08 07:23:04 +0900
committerMarc Cornellà <marc.cornella@live.com>2016-09-08 00:23:04 +0200
commit27fff27253ec7f631f3f9e51f0a9f37214d67f17 (patch)
treeaef11a37107f3b68afd0a0c0e3937eec742e5167 /lib/git.zsh
parent71201ffd67da9bb8a60d998ebce4dfe7e1039c98 (diff)
downloadzsh-27fff27253ec7f631f3f9e51f0a9f37214d67f17.tar.gz
zsh-27fff27253ec7f631f3f9e51f0a9f37214d67f17.tar.bz2
zsh-27fff27253ec7f631f3f9e51f0a9f37214d67f17.zip
Fix git_prompt_status() not showing ahead/behind/diverged status correctly (#5388)
Diffstat (limited to 'lib/git.zsh')
-rw-r--r--lib/git.zsh6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/git.zsh b/lib/git.zsh
index b9069ff12..f7eccb81d 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -165,13 +165,13 @@ function git_prompt_status() {
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
- if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
+ if $(echo "$INDEX" | grep '^## [^ ]\+ .*ahead' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
fi
- if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
+ if $(echo "$INDEX" | grep '^## [^ ]\+ .*behind' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
fi
- if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
+ if $(echo "$INDEX" | grep '^## [^ ]\+ .*diverged' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
fi
echo $STATUS