diff options
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 3b0578ba..dca34928 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -127,18 +127,14 @@ prompt() { # Collect symbols representing repository state local state - if ! git diff-files --quiet ; then + git diff-files --quiet || state=${state}! - fi - if ! git diff-index --cached --quiet HEAD ; then + git diff-index --cached --quiet HEAD || state=${state}+ - fi - if [[ -n $(git ls-files --others --exclude-standard) ]] ; then + [[ -n $(git ls-files --others --exclude-standard) ]] && state=${state}\? - fi - if git rev-parse --quiet --verify refs/stash >/dev/null ; then + git rev-parse --quiet --verify refs/stash >/dev/null && state=${state}^ - fi # Print the status in brackets; add a git: prefix only if there # might be another VCS prompt (because PROMPT_VCS is set) |