3 test_description
='ls-tree with(out) globs'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'setup' '
10 touch a/one aa/two "a[a]/three" &&
11 git add a/one aa/two "a[a]/three" &&
15 test_expect_success
'ls-tree a[a] matches literally' '
17 100644 blob $EMPTY_BLOB a[a]/three
19 git ls-tree -r HEAD "a[a]" >actual &&
20 test_cmp expect actual
23 test_expect_success
'ls-tree outside prefix' '
25 100644 blob $EMPTY_BLOB ../a[a]/three
27 ( cd aa && git ls-tree -r HEAD "../a[a]" ) >actual &&
28 test_cmp expect actual
31 test_expect_failure
'ls-tree does not yet support negated pathspec' '
32 git ls-files ":(exclude)a" "a*" >expect &&
33 git ls-tree --name-only -r HEAD ":(exclude)a" "a*" >actual &&
34 test_cmp expect actual