Add variables that can be used to wrap the git status prompt.

Also return if working copy is clean.
This commit is contained in:
Ali B 2011-08-07 13:53:23 +10:00
commit c09b59d96a

View file

@ -32,8 +32,8 @@ function git_prompt_long_sha() {
# Get the status of the working tree
git_prompt_status() {
INDEX=$(git status --porcelain 2> /dev/null)
STATUS=""
INDEX=$(git status --porcelain 2> /dev/null) || return
STATUS="$ZSH_THEME_GIT_STATUS_AFTER"
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
fi
@ -60,5 +60,5 @@ git_prompt_status() {
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
echo $STATUS
echo "$ZSH_THEME_GIT_STATUS_BEFORE$STATUS"
}