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 | Merge branch 'cb/uname-in-untracked' (diff) | |
parent | bash prompt: faster untracked status indicator with untracked directories (diff) | |
download | tgif-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-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 && ( |