Faster dirty git status check (using git diff)

This commit is contained in:
Yoav Weiss 2013-01-27 14:50:33 +01:00
parent 615e41b0ec
commit 2e213b9b8f

View file

@ -13,7 +13,7 @@ parse_git_dirty() {
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
if [[ -n $(git diff --ignore-submodules HEAD 2> /dev/null) ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"