aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-03 11:01:26 -0700
committerJunio C Hamano <gitster@pobox.com>2015-08-03 11:01:26 -0700
commit461c119739389430e9f978426f25a12690a1831c (patch)
tree5cf4279b6be8518f9febf753aeaedb35c0e270fa /t
parent8e699cdb9fc88177617329a10af3c9b28185f2c8 (diff)
parentdd160d794f0bf02c30d2e5032e216b1e8ac14222 (diff)
downloadgit-461c119739389430e9f978426f25a12690a1831c.tar.gz
git-461c119739389430e9f978426f25a12690a1831c.tar.xz
Merge branch 'sg/bash-prompt-untracked-optim'
Optimize computation of untracked status indicator by bash prompt script (in contrib/). * sg/bash-prompt-untracked-optim: bash prompt: faster untracked status indicator with untracked directories bash prompt: test untracked files status indicator with untracked dirs
Diffstat (limited to 't')
-rwxr-xr-xt/t9903-bash-prompt.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 49d58e672..6b68777b9 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -397,6 +397,31 @@ test_expect_success 'prompt - untracked files status indicator - untracked files
test_cmp expected "$actual"
'
+test_expect_success 'prompt - untracked files status indicator - empty untracked dir' '
+ printf " (master)" >expected &&
+ mkdir otherrepo/untracked-dir &&
+ test_when_finished "rm -rf otherrepo/untracked-dir" &&
+ (
+ GIT_PS1_SHOWUNTRACKEDFILES=y &&
+ cd otherrepo &&
+ __git_ps1 >"$actual"
+ ) &&
+ test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - untracked files status indicator - non-empty untracked dir' '
+ printf " (master %%)" >expected &&
+ mkdir otherrepo/untracked-dir &&
+ test_when_finished "rm -rf otherrepo/untracked-dir" &&
+ >otherrepo/untracked-dir/untracked-file &&
+ (
+ GIT_PS1_SHOWUNTRACKEDFILES=y &&
+ cd otherrepo &&
+ __git_ps1 >"$actual"
+ ) &&
+ test_cmp expected "$actual"
+'
+
test_expect_success 'prompt - untracked files status indicator - untracked files outside cwd' '
printf " (master %%)" >expected &&
(