diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-24 22:52:17 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-24 22:52:17 +1200 |
commit | 89e2c41c46d0893c9ac80ce6804cd6aeff2fbc02 (patch) | |
tree | 21ab16f6b468971a0e2ffc8ce06f236f03d40ed5 /bash/bashrc.d | |
parent | Reassure shellcheck about ls(1) piping (diff) | |
download | dotfiles-89e2c41c46d0893c9ac80ce6804cd6aeff2fbc02.tar.gz dotfiles-89e2c41c46d0893c9ac80ce6804cd6aeff2fbc02.zip |
Refine git prompt commands a bit
Informed by git-prompt.sh from the Git source distribution
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 1a7a1c6f..ea2ba7f2 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -126,15 +126,16 @@ prompt() { ((ahead)) && state=${state}'>' # Tracked files are modified - git diff-files --quiet || + git diff-files --no-ext-diff --quiet || state=${state}'!' # Changes are staged - git diff-index --cached --quiet HEAD 2>/dev/null || + git diff-index --cached --no-ext-diff --quiet HEAD 2>/dev/null || state=${state}'+' # There are some untracked and unignored files - [[ -n $(git ls-files --others --exclude-standard) ]] && + git ls-files --directory --error-unmatch --exclude-standard \ + --no-empty-directory --others -- ':/*' >/dev/null 2>&1 && state=${state}'?' # There are stashed changes |