From 27fff27253ec7f631f3f9e51f0a9f37214d67f17 Mon Sep 17 00:00:00 2001 From: Yuichi Tanikawa Date: Thu, 8 Sep 2016 07:23:04 +0900 Subject: [PATCH] Fix git_prompt_status() not showing ahead/behind/diverged status correctly (#5388) --- lib/git.zsh | 6 +++--- 1 file 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