Code

unpack-trees: fix sparse checkout's "unable to match directories"
[git.git] / t / t1011-read-tree-sparse-checkout.sh
index 8008fa2d894baf76a19168a020ed4f4640619ce7..67d9217bf45dbd40b269584a1ab8a5fe39b8b8ab 100755 (executable)
@@ -94,12 +94,20 @@ test_expect_success 'match directories with trailing slash' '
        test -f sub/added
 '
 
-test_expect_failure 'match directories without trailing slash' '
-       echo init.t >.git/info/sparse-checkout &&
+test_expect_success 'match directories without trailing slash' '
        echo sub >>.git/info/sparse-checkout &&
        git read-tree -m -u HEAD &&
        git ls-files -t >result &&
-       test_cmp expected.swt result &&
+       test_cmp expected.swt-noinit result &&
+       test ! -f init.t &&
+       test -f sub/added
+'
+
+test_expect_success 'match directory pattern' '
+       echo "s?b" >>.git/info/sparse-checkout &&
+       git read-tree -m -u HEAD &&
+       git ls-files -t >result &&
+       test_cmp expected.swt-noinit result &&
        test ! -f init.t &&
        test -f sub/added
 '