From c09b59d96a778769325280f6185a73dc984edcad Mon Sep 17 00:00:00 2001 From: Ali B Date: Sun, 7 Aug 2011 13:53:23 +1000 Subject: [PATCH] Add variables that can be used to wrap the git status prompt. Also return if working copy is clean. --- lib/git.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index f04343650..c2b490c04 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -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" }