diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-08-03 11:01:26 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-03 11:01:26 -0700 |
commit | 461c119739389430e9f978426f25a12690a1831c (patch) | |
tree | 5cf4279b6be8518f9febf753aeaedb35c0e270fa /t | |
parent | 8e699cdb9fc88177617329a10af3c9b28185f2c8 (diff) | |
parent | dd160d794f0bf02c30d2e5032e216b1e8ac14222 (diff) | |
download | git-461c119739389430e9f978426f25a12690a1831c.tar.gz |
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-x | t/t9903-bash-prompt.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh index 49d58e6726..6b68777b98 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 && ( |