summaryrefslogtreecommitdiff
path: root/t/t3001-ls-files-others-exclude.sh
diff options
context:
space:
mode:
authorKarsten Blees <karsten.blees@gmail.com>2013-04-15 21:08:02 +0200
committerJunio C Hamano <gitster@pobox.com>2013-04-15 12:33:59 -0700
commit184d2a8e964d721c20775026308fcf63d57c0b4d (patch)
tree4f88e5c52142ceef9c44c4326bcc77beecf431e3 /t/t3001-ls-files-others-exclude.sh
parent0104c9e7816e30701e4fdd9143889faacfa0eefa (diff)
downloadgit-184d2a8e964d721c20775026308fcf63d57c0b4d.tar.gz
dir.c: git-ls-files --directories: don't hide empty directories
'git-ls-files --ignored --directories' hides empty directories even though --no-empty-directory was not specified. Treat the DIR_HIDE_EMPTY_DIRECTORIES flag independently from DIR_SHOW_IGNORED to make all git-ls-files options work as expected. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3001-ls-files-others-exclude.sh')
-rwxr-xr-xt/t3001-ls-files-others-exclude.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index efb7ebc91f..859da350ab 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -214,6 +214,29 @@ 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 'pattern matches prefix completely' '
: >expect &&
git ls-files -i -o --exclude "/three/a.3[abc]" >actual &&