3 test_description
='rev-list/rev-parse --glob'
15 # Split arguments on whitespace.
16 git
$1 $2 >expected
&&
18 test_cmp expected actual
21 test_expect_success
'setup' '
24 git checkout -b subspace/one master &&
26 git checkout -b subspace/two master &&
28 git checkout -b subspace-x master &&
30 git checkout -b other/three master &&
32 git checkout -b someref master &&
34 git checkout master &&
36 git tag foo/bar master &&
38 git update-ref refs/remotes/foo/baz master &&
42 test_expect_success
'rev-parse --glob=refs/heads/subspace/*' '
44 compare rev-parse "subspace/one subspace/two" "--glob=refs/heads/subspace/*"
48 test_expect_success
'rev-parse --glob=heads/subspace/*' '
50 compare rev-parse "subspace/one subspace/two" "--glob=heads/subspace/*"
54 test_expect_success
'rev-parse --glob=refs/heads/subspace/' '
56 compare rev-parse "subspace/one subspace/two" "--glob=refs/heads/subspace/"
60 test_expect_success
'rev-parse --glob=heads/subspace/' '
62 compare rev-parse "subspace/one subspace/two" "--glob=heads/subspace/"
66 test_expect_success
'rev-parse --glob=heads/subspace' '
68 compare rev-parse "subspace/one subspace/two" "--glob=heads/subspace"
72 test_expect_success
'rev-parse --branches=subspace/*' '
74 compare rev-parse "subspace/one subspace/two" "--branches=subspace/*"
78 test_expect_success
'rev-parse --branches=subspace/' '
80 compare rev-parse "subspace/one subspace/two" "--branches=subspace/"
84 test_expect_success
'rev-parse --branches=subspace' '
86 compare rev-parse "subspace/one subspace/two" "--branches=subspace"
90 test_expect_success
'rev-parse --glob=heads/subspace/* --glob=heads/other/*' '
92 compare rev-parse "subspace/one subspace/two other/three" "--glob=heads/subspace/* --glob=heads/other/*"
96 test_expect_success
'rev-parse --glob=heads/someref/* master' '
98 compare rev-parse "master" "--glob=heads/someref/* master"
102 test_expect_success
'rev-parse --glob=heads/*' '
104 compare rev-parse "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
108 test_expect_success
'rev-parse --tags=foo' '
110 compare rev-parse "foo/bar" "--tags=foo"
114 test_expect_success
'rev-parse --remotes=foo' '
116 compare rev-parse "foo/baz" "--remotes=foo"
120 test_expect_success
'rev-list --glob=refs/heads/subspace/*' '
122 compare rev-list "subspace/one subspace/two" "--glob=refs/heads/subspace/*"
126 test_expect_success
'rev-list --glob refs/heads/subspace/*' '
128 compare rev-list "subspace/one subspace/two" "--glob refs/heads/subspace/*"
132 test_expect_success
'rev-list --glob=heads/subspace/*' '
134 compare rev-list "subspace/one subspace/two" "--glob=heads/subspace/*"
138 test_expect_success
'rev-list --glob=refs/heads/subspace/' '
140 compare rev-list "subspace/one subspace/two" "--glob=refs/heads/subspace/"
144 test_expect_success
'rev-list --glob=heads/subspace/' '
146 compare rev-list "subspace/one subspace/two" "--glob=heads/subspace/"
150 test_expect_success
'rev-list --glob=heads/subspace' '
152 compare rev-list "subspace/one subspace/two" "--glob=heads/subspace"
156 test_expect_success
'rev-list --branches=subspace/*' '
158 compare rev-list "subspace/one subspace/two" "--branches=subspace/*"
162 test_expect_success
'rev-list --branches=subspace/' '
164 compare rev-list "subspace/one subspace/two" "--branches=subspace/"
168 test_expect_success
'rev-list --branches=subspace' '
170 compare rev-list "subspace/one subspace/two" "--branches=subspace"
174 test_expect_success
'rev-list --branches' '
176 compare rev-list "master subspace-x someref other/three subspace/one subspace/two" "--branches"
180 test_expect_success
'rev-list --glob=heads/someref/* master' '
182 compare rev-list "master" "--glob=heads/someref/* master"
186 test_expect_success
'rev-list --glob=heads/subspace/* --glob=heads/other/*' '
188 compare rev-list "subspace/one subspace/two other/three" "--glob=heads/subspace/* --glob=heads/other/*"
192 test_expect_success
'rev-list --glob=heads/*' '
194 compare rev-list "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
198 test_expect_success
'rev-list --tags=foo' '
200 compare rev-list "foo/bar" "--tags=foo"
204 test_expect_success
'rev-list --tags' '
206 compare rev-list "foo/bar" "--tags"
210 test_expect_success
'rev-list --remotes=foo' '
212 compare rev-list "foo/baz" "--remotes=foo"