83fca8df8b3672446eb5f78515934a5f78646023
1#!/bin/sh
2
3test_description='ls-tree with(out) globs'
4
5. ./test-lib.sh
6
7test_expect_success 'setup' '
8 mkdir a aa "a[a]" &&
9 touch a/one aa/two "a[a]/three" &&
10 git add a/one aa/two "a[a]/three" &&
11 git commit -m test
12'
13
14test_expect_success 'ls-tree a[a] matches literally' '
15 cat >expected <<EOF &&
16100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a[a]/three
17EOF
18 git ls-tree -r HEAD "a[a]" >actual &&
19 test_cmp expected actual
20'
21
22test_expect_success 'ls-tree outside prefix' '
23 cat >expected <<EOF &&
24100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 ../a[a]/three
25EOF
26 ( cd aa && git ls-tree -r HEAD "../a[a]"; ) >actual &&
27 test_cmp expected actual
28'
29
30test_done