diff options
author | Robby Russell <robby@planetargon.com> | 2013-04-07 19:06:31 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2013-04-07 19:06:31 -0700 |
commit | cd55560c74820cdf4fa269dab4126b27c732573b (patch) | |
tree | 28aea10a78c00290d1aa1451f88b7991acdc18eb /lib/git.zsh | |
parent | dda1154c80ec0b8ad02846240e4c5d701279b296 (diff) | |
parent | 72ec24108a88d79a13cc3581f17b440418048a72 (diff) | |
download | zsh-cd55560c74820cdf4fa269dab4126b27c732573b.tar.gz zsh-cd55560c74820cdf4fa269dab4126b27c732573b.tar.bz2 zsh-cd55560c74820cdf4fa269dab4126b27c732573b.zip |
Merge pull request #1654 from bertag/parse-git-dirty-support-for-1.6
parse_git_dirty() support for Git 1.6
Diffstat (limited to 'lib/git.zsh')
-rw-r--r-- | lib/git.zsh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/git.zsh b/lib/git.zsh index 98c00bd8a..76fe9b142 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -9,16 +9,19 @@ function git_prompt_info() { # Checks if working tree is dirty parse_git_dirty() { local SUBMODULE_SYNTAX='' + local GIT_STATUS='' + local CLEAN_MESSAGE='nothing to commit (working directory clean)' if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then if [[ $POST_1_7_2_GIT -gt 0 ]]; then SUBMODULE_SYNTAX="--ignore-submodules=dirty" - fi - if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then + fi + GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1) + if [[ -n $GIT_STATUS && "$GIT_STATUS" != "$CLEAN_MESSAGE" ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else echo "$ZSH_THEME_GIT_PROMPT_CLEAN" - fi - fi + fi + fi } # get the difference between the local and remote branches |