Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh into old-git-status

Conflicts:
	lib/git.zsh
This commit is contained in:
Nick Aldwin 2013-01-24 18:20:27 -05:00
commit c7f80cb817
7 changed files with 72 additions and 30 deletions

View file

@ -9,21 +9,23 @@ function git_prompt_info() {
# Checks if working tree is dirty
parse_git_dirty() {
local SUBMODULE_SYNTAX=''
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
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
local GIT_DIRTY=0
# see https://github.com/robbyrussell/oh-my-zsh/commit/3c87d483628267e48fc0f462f46488dcd4f87810
# and https://github.com/robbyrussell/oh-my-zsh/issues/40
if [[ $POST_1_6_4_GIT -gt 0 ]]; then
fi
local GIT_DIRTY=0
# see https://github.com/robbyrussell/oh-my-zsh/commit/3c87d483628267e48fc0f462f46488dcd4f87810
# and https://github.com/robbyrussell/oh-my-zsh/issues/40
if [[ $POST_1_6_4_GIT -gt 0 ]]; then
[[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]] && GIT_DIRTY=1
else
else
[[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]] && GIT_DIRTY=1
fi
if (( GIT_DIRTY )); then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
if (( GIT_DIRTY )); then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
fi
}