Close GH-80: Include untracked files in dirtiness check. Fixes #1, Fixes #79

This commit is contained in:
Max Shishkin
2014-08-09 17:41:30 +02:00
committed by Sindre Sorhus
parent 18c3d66dd5
commit 1d97762b7a
2 changed files with 7 additions and 2 deletions

View File

@@ -36,9 +36,10 @@ prompt_pure_git_dirty() {
# check if we're in a git repo
command git rev-parse --is-inside-work-tree &>/dev/null || return
# check if it's dirty
command git diff --quiet --ignore-submodules HEAD &>/dev/null
[[ "$PURE_GIT_UNTRACKED_DIRTY" == 0 ]] && local umode="-uno" || local umode="-unormal"
command test -n "$(git status --porcelain --ignore-submodules ${umode})"
(($? == 1)) && echo '*'
(($? == 0)) && echo '*'
}
# displays the exec time of the last command if set threshold was exceeded