Support oh-my-zsh.hide-status in git_prompt_status()

This commit is contained in:
Zeeshan Qureshi 2014-04-10 13:01:07 -04:00
commit 7ed2ff87ab

View file

@ -71,8 +71,9 @@ function git_prompt_long_sha() {
# Get the status of the working tree # Get the status of the working tree
git_prompt_status() { git_prompt_status() {
INDEX=$(command git status --porcelain -b 2> /dev/null)
STATUS="" STATUS=""
if [[ "$(command git config --get oh-my-zsh.hide-status)" != "1" ]]; then
INDEX=$(command git status --porcelain -b 2> /dev/null)
if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
fi fi
@ -113,6 +114,7 @@ git_prompt_status() {
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
fi
echo $STATUS echo $STATUS
} }