aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-24 22:52:17 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-24 22:52:17 +1200
commit89e2c41c46d0893c9ac80ce6804cd6aeff2fbc02 (patch)
tree21ab16f6b468971a0e2ffc8ce06f236f03d40ed5 /bash/bashrc.d
parentReassure shellcheck about ls(1) piping (diff)
downloaddotfiles-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.bash7
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