mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
Fix git_prompt_status() not showing ahead/behind/diverged status correctly (#5388)
This commit is contained in:
parent
71201ffd67
commit
27fff27253
1 changed files with 3 additions and 3 deletions
|
@ -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 a new issue