summaryrefslogtreecommitdiff
path: root/t/t9903-bash-prompt.sh
diff options
context:
space:
mode:
authorCody A Taylor <codemister99@yahoo.com>2015-03-13 02:24:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-03-15 21:23:22 (GMT)
commit9bdc5173f0bc514d0b76165d45729622b2ad4d89 (patch)
treeda1c268253553011c696fe35e25a35a0fca5a13f /t/t9903-bash-prompt.sh
parent282616c72d1d08a77ca4fe1186cb708c38408d87 (diff)
downloadgit-9bdc5173f0bc514d0b76165d45729622b2ad4d89.zip
git-9bdc5173f0bc514d0b76165d45729622b2ad4d89.tar.gz
git-9bdc5173f0bc514d0b76165d45729622b2ad4d89.tar.bz2
git prompt: use toplevel to find untracked files
The __git_ps1() prompt function would not show an untracked state when all the untracked files are outside the current working directory. Signed-off-by: Cody A Taylor <codemister99@yahoo.com> Helped-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9903-bash-prompt.sh')
-rwxr-xr-xt/t9903-bash-prompt.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 9150984..43cfefd 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -395,6 +395,17 @@ test_expect_success 'prompt - untracked files status indicator - untracked files
test_cmp expected "$actual"
'
+test_expect_success 'prompt - untracked files status indicator - untracked files outside cwd' '
+ printf " (master %%)" >expected &&
+ (
+ mkdir -p ignored_dir &&
+ cd ignored_dir &&
+ GIT_PS1_SHOWUNTRACKEDFILES=y &&
+ __git_ps1 >"$actual"
+ ) &&
+ test_cmp expected "$actual"
+'
+
test_expect_success 'prompt - untracked files status indicator - shell variable unset with config disabled' '
printf " (master)" >expected &&
test_config bash.showUntrackedFiles false &&