improvement in git_prompt_status function

This commit is contained in:
Eder Ruiz Maria 2012-10-13 05:08:56 -04:00
commit a955f0c282

View file

@ -38,6 +38,9 @@ function git_prompt_long_sha() {
# Get the status of the working tree
git_prompt_status() {
if ! git status &> /dev/null; then
return
fi
INDEX=$(git status --porcelain 2> /dev/null)
STATUS=""
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
@ -66,6 +69,8 @@ git_prompt_status() {
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
STATUS="$ZSH_THEME_GIT_PROMPT_STATUS_PREFIX$STATUS"
STATUS+="$ZSH_THEME_GIT_PROMPT_STATUS_SUFFIX"
echo $STATUS
}