Git 2.45
[git/gitster.git] / t / t3102-ls-tree-wildcards.sh
blob3942db229000e0c367a93b200f30c57bba95e7ee
1 #!/bin/sh
3 test_description='ls-tree with(out) globs'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success 'setup' '
9 mkdir a aa "a[a]" &&
10 touch a/one aa/two "a[a]/three" &&
11 git add a/one aa/two "a[a]/three" &&
12 git commit -m test
15 test_expect_success 'ls-tree a[a] matches literally' '
16 cat >expect <<-EOF &&
17 100644 blob $EMPTY_BLOB a[a]/three
18 EOF
19 git ls-tree -r HEAD "a[a]" >actual &&
20 test_cmp expect actual
23 test_expect_success 'ls-tree outside prefix' '
24 cat >expect <<-EOF &&
25 100644 blob $EMPTY_BLOB ../a[a]/three
26 EOF
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
37 test_done