summaryrefslogtreecommitdiff
path: root/t/t3001-ls-files-others-exclude.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-23 18:21:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-23 18:21:23 (GMT)
commit7093d2c0dd986c70a98b712440b34f98599b3539 (patch)
treed4c22d38c71d388dce709fc36d6318ca873f9570 /t/t3001-ls-files-others-exclude.sh
parent9e94f9ba9e902d48c75df6ba53e6e87cefe187a8 (diff)
parent0aaf62b6e018484bad9cea47dc00644d57b7ad49 (diff)
downloadgit-7093d2c0dd986c70a98b712440b34f98599b3539.zip
git-7093d2c0dd986c70a98b712440b34f98599b3539.tar.gz
git-7093d2c0dd986c70a98b712440b34f98599b3539.tar.bz2
Merge branch 'kb/status-ignored-optim-2'
Fixes a handful of issues in the code to traverse working tree to find untracked and/or ignored files, cleans up and optimizes the codepath in general. * kb/status-ignored-optim-2: dir.c: git-status --ignored: don't scan the work tree twice dir.c: git-status --ignored: don't scan the work tree three times dir.c: git-status: avoid is_excluded checks for tracked files dir.c: replace is_path_excluded with now equivalent is_excluded API dir.c: unify is_excluded and is_path_excluded APIs dir.c: move prep_exclude dir.c: factor out parts of last_exclude_matching for later reuse dir.c: git-clean -d -X: don't delete tracked directories dir.c: make 'git-status --ignored' work within leading directories dir.c: git-status --ignored: don't list empty directories as ignored dir.c: git-ls-files --directories: don't hide empty directories dir.c: git-status --ignored: don't list empty ignored directories dir.c: git-status --ignored: don't list files in ignored directories dir.c: git-status --ignored: don't drop ignored directories
Diffstat (limited to 't/t3001-ls-files-others-exclude.sh')
-rwxr-xr-xt/t3001-ls-files-others-exclude.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index 2d274bf..4e3735f 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -214,6 +214,55 @@ test_expect_success 'subdirectory ignore (l1)' '
test_cmp expect actual
'
+test_expect_success 'show/hide empty ignored directory (setup)' '
+ rm top/l1/l2/l1 &&
+ rm top/l1/.gitignore
+'
+
+test_expect_success 'show empty ignored directory with --directory' '
+ (
+ cd top &&
+ git ls-files -o -i --exclude l1 --directory
+ ) >actual &&
+ echo l1/ >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'hide empty ignored directory with --no-empty-directory' '
+ (
+ cd top &&
+ git ls-files -o -i --exclude l1 --directory --no-empty-directory
+ ) >actual &&
+ >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'show/hide empty ignored sub-directory (setup)' '
+ > top/l1/tracked &&
+ (
+ cd top &&
+ git add -f l1/tracked
+ )
+'
+
+test_expect_success 'show empty ignored sub-directory with --directory' '
+ (
+ cd top &&
+ git ls-files -o -i --exclude l1 --directory
+ ) >actual &&
+ echo l1/l2/ >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success 'hide empty ignored sub-directory with --no-empty-directory' '
+ (
+ cd top &&
+ git ls-files -o -i --exclude l1 --directory --no-empty-directory
+ ) >actual &&
+ >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'pattern matches prefix completely' '
: >expect &&
git ls-files -i -o --exclude "/three/a.3[abc]" >actual &&