]>
Commit | Line | Data |
---|---|---|
f0096c06 NTND |
1 | #!/bin/sh |
2 | ||
145f86a0 | 3 | test_description='ls-tree with(out) globs' |
f0096c06 | 4 | |
809aeedb | 5 | TEST_PASSES_SANITIZE_LEAK=true |
f0096c06 NTND |
6 | . ./test-lib.sh |
7 | ||
8 | test_expect_success 'setup' ' | |
145f86a0 JS |
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" && | |
f0096c06 NTND |
12 | git commit -m test |
13 | ' | |
14 | ||
145f86a0 | 15 | test_expect_success 'ls-tree a[a] matches literally' ' |
378932d3 NTND |
16 | cat >expect <<-EOF && |
17 | 100644 blob $EMPTY_BLOB a[a]/three | |
f1f6224c | 18 | EOF |
145f86a0 | 19 | git ls-tree -r HEAD "a[a]" >actual && |
f1f6224c | 20 | test_cmp expect actual |
f0096c06 NTND |
21 | ' |
22 | ||
1cf9952d | 23 | test_expect_success 'ls-tree outside prefix' ' |
378932d3 NTND |
24 | cat >expect <<-EOF && |
25 | 100644 blob $EMPTY_BLOB ../a[a]/three | |
f1f6224c | 26 | EOF |
02779185 | 27 | ( cd aa && git ls-tree -r HEAD "../a[a]" ) >actual && |
f1f6224c | 28 | test_cmp expect actual |
1cf9952d NTND |
29 | ' |
30 | ||
4be4f71f JH |
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 | |
35 | ' | |
36 | ||
f0096c06 | 37 | test_done |