aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-17 15:25:46 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-17 15:25:46 -0800
commitadbbc6f29121aee3aec383a9ac05092c79908033 (patch)
tree169dc249e70e435b0ec6e09cec1c280478e1cb96 /contrib
parent00abd715ab0a2cd69f9d27ea15c5440002f970b8 (diff)
parentdc7e7bced41b3a362a94cb1670ff183459d8d3a8 (diff)
downloadgit-adbbc6f29121aee3aec383a9ac05092c79908033.tar.gz
git-adbbc6f29121aee3aec383a9ac05092c79908033.tar.xz
Merge branch 'mw/bash-prompt-show-untracked-config'
Allows skipping the untracked check GIT_PS1_SHOWUNTRACKEDFILES asks for the git-prompt (in contrib/) per repository. * mw/bash-prompt-show-untracked-config: t9903: add extra tests for bash.showDirtyState t9903: add tests for bash.showUntrackedFiles shell prompt: add bash.showUntrackedFiles option
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-prompt.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 9bef0531c..9b2eec21e 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -43,7 +43,10 @@
#
# If you would like to see if there're untracked files, then you can set
# GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked
-# files, then a '%' will be shown next to the branch name.
+# files, then a '%' will be shown next to the branch name. You can
+# configure this per-repository with the bash.showUntrackedFiles
+# variable, which defaults to true once GIT_PS1_SHOWUNTRACKEDFILES is
+# enabled.
#
# If you would like to see the difference between HEAD and its upstream,
# set GIT_PS1_SHOWUPSTREAM="auto". A "<" indicates you are behind, ">"
@@ -332,8 +335,10 @@ __git_ps1 ()
fi
if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]; then
- if [ -n "$(git ls-files --others --exclude-standard)" ]; then
- u="%"
+ if [ "$(git config --bool bash.showUntrackedFiles)" != "false" ]; then
+ if [ -n "$(git ls-files --others --exclude-standard)" ]; then
+ u="%"
+ fi
fi
fi