summaryrefslogtreecommitdiff
path: root/t/t3000-ls-files-others.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t3000-ls-files-others.sh')
-rwxr-xr-xt/t3000-ls-files-others.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/t3000-ls-files-others.sh b/t/t3000-ls-files-others.sh
index b7e0306316..86291e8399 100755
--- a/t/t3000-ls-files-others.sh
+++ b/t/t3000-ls-files-others.sh
@@ -13,6 +13,7 @@ filesystem.
path2/file2 - a file in a directory
path3-junk - a file to confuse things
path3/file3 - a file in a directory
+ path4 - an empty directory
'
. ./test-lib.sh
@@ -23,7 +24,7 @@ then
else
date > path1
fi
-mkdir path2 path3
+mkdir path2 path3 path4
date >path2/file2
date >path2-junk
date >path3/file3
@@ -33,6 +34,7 @@ git update-index --add path3-junk path3/file3
cat >expected1 <<EOF
expected1
expected2
+expected3
output
path0
path1
@@ -40,6 +42,8 @@ path2-junk
path2/file2
EOF
sed -e 's|path2/file2|path2/|' <expected1 >expected2
+cat <expected2 >expected3
+echo path4/ >>expected2
test_expect_success \
'git ls-files --others to show output.' \
@@ -58,4 +62,12 @@ test_expect_success \
'git ls-files --others --directory should not get confused.' \
'test_cmp expected2 output'
+test_expect_success \
+ 'git ls-files --others --directory --no-empty-directory to show output.' \
+ 'git ls-files --others --directory --no-empty-directory >output'
+
+test_expect_success \
+ '--no-empty-directory hides empty directory' \
+ 'test_cmp expected3 output'
+
test_done