Fix git_prompt_status() not showing ahead/behind/diverged status correctly (#5388)
This commit is contained in:
parent
71201ffd67
commit
27fff27253
@ -165,13 +165,13 @@ function git_prompt_status() {
|
|||||||
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
|
||||||
fi
|
fi
|
||||||
if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^## [^ ]\+ .*ahead' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
|
||||||
fi
|
fi
|
||||||
if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^## [^ ]\+ .*behind' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
|
||||||
fi
|
fi
|
||||||
if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^## [^ ]\+ .*diverged' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
|
||||||
fi
|
fi
|
||||||
echo $STATUS
|
echo $STATUS
|
||||||
|
Loading…
Reference in New Issue
Block a user