From e41714d72c6c5629efe632b1052b590f5f8905c5 Mon Sep 17 00:00:00 2001 From: Jeremy Attali Date: Mon, 22 Apr 2013 10:59:08 +0200 Subject: Added option to allow untracked files as non dirty In this commit, the option only works for git but it should not be to hard for someone who knows svn to so the same. This commit is largely inspired by @yoavweiss, I only added an option to use it. --- lib/git.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/git.zsh') diff --git a/lib/git.zsh b/lib/git.zsh index 76fe9b142..5f8453112 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -15,7 +15,11 @@ parse_git_dirty() { if [[ $POST_1_7_2_GIT -gt 0 ]]; then SUBMODULE_SYNTAX="--ignore-submodules=dirty" fi - GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1) + if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" != "true" ]]; then + GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1) + else + GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1) + fi if [[ -n $GIT_STATUS && "$GIT_STATUS" != "$CLEAN_MESSAGE" ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else -- cgit v1.2.3-70-g09d2