211
0:commit::$(git rev-parse topic)
212
1:tree::$(git rev-parse topic^{tree})
213
2:tree:right/:$(git rev-parse topic:right)
214
- 3:blob:right/d:$(git rev-parse topic:right/d)
214
+ 3:blob:right/d:$(git rev-parse topic:right/d):UNINTERESTING
215
4:blob:right/c:$(git rev-parse topic:right/c)
216
- 5:tree:left/:$(git rev-parse topic:left)
217
- 6:blob:left/b:$(git rev-parse topic:left/b)
218
- 7:blob:a:$(git rev-parse topic:a)
216
+ 5:tree:left/:$(git rev-parse topic:left):UNINTERESTING
217
+ 6:blob:left/b:$(git rev-parse topic:left/b):UNINTERESTING
218
+ 7:blob:a:$(git rev-parse topic:a):UNINTERESTING
219
blobs:4
220
commits:1
221
tags:0
225
test_cmp_sorted expect out
226
'
227
228
+test_expect_success 'fourth, blob-tag2, not base' '
229
+ test-tool path-walk -- fourth blob-tag2 --not base >out &&
230
+
231
+ cat >expect <<-EOF &&
232
+ 0:commit::$(git rev-parse topic)
233
+ 1:tag:/tags:$(git rev-parse fourth)
234
+ 2:blob:/tagged-blobs:$(git rev-parse refs/tags/blob-tag2^{})
235
+ 3:tree::$(git rev-parse topic^{tree})
236
+ 4:tree:right/:$(git rev-parse topic:right)
237
+ 5:blob:right/d:$(git rev-parse base~1:right/d):UNINTERESTING
238
+ 6:blob:right/c:$(git rev-parse topic:right/c)
239
+ 7:tree:left/:$(git rev-parse base~1:left):UNINTERESTING
240
+ 8:blob:left/b:$(git rev-parse base~1:left/b):UNINTERESTING
241
+ 9:blob:a:$(git rev-parse base~1:a):UNINTERESTING
242
+ blobs:5
243
+ commits:1
244
+ tags:1
245
+ trees:3
246
+ EOF
247
+
248
+ test_cmp_sorted expect out
249
+'
250
+
251
test_expect_success 'topic, not base, only blobs' '
252
test-tool path-walk --no-trees --no-commits \
253
-- topic --not base >out &&
254
255
cat >expect <<-EOF &&
233
- 0:blob:right/d:$(git rev-parse topic:right/d)
256
+ 0:blob:right/d:$(git rev-parse topic:right/d):UNINTERESTING
257
1:blob:right/c:$(git rev-parse topic:right/c)
235
- 2:blob:left/b:$(git rev-parse topic:left/b)
236
- 3:blob:a:$(git rev-parse topic:a)
258
+ 2:blob:left/b:$(git rev-parse topic:left/b):UNINTERESTING
259
+ 3:blob:a:$(git rev-parse topic:a):UNINTERESTING
260
blobs:4
261
commits:0
262
tags:0
290
cat >expect <<-EOF &&
291
0:tree::$(git rev-parse topic^{tree})
292
1:tree:right/:$(git rev-parse topic:right)
270
- 2:tree:left/:$(git rev-parse topic:left)
293
+ 2:tree:left/:$(git rev-parse topic:left):UNINTERESTING
294
commits:0
295
blobs:0
296
tags:0
305
306
cat >expect <<-EOF &&
307
0:commit::$(git rev-parse topic)
285
- 0:commit::$(git rev-parse base~1)
308
+ 0:commit::$(git rev-parse base~1):UNINTERESTING
309
1:tree::$(git rev-parse topic^{tree})
287
- 1:tree::$(git rev-parse base~1^{tree})
310
+ 1:tree::$(git rev-parse base~1^{tree}):UNINTERESTING
311
2:tree:right/:$(git rev-parse topic:right)
289
- 2:tree:right/:$(git rev-parse base~1:right)
290
- 3:blob:right/d:$(git rev-parse base~1:right/d)
291
- 4:blob:right/c:$(git rev-parse base~1:right/c)
312
+ 2:tree:right/:$(git rev-parse base~1:right):UNINTERESTING
313
+ 3:blob:right/d:$(git rev-parse base~1:right/d):UNINTERESTING
314
+ 4:blob:right/c:$(git rev-parse base~1:right/c):UNINTERESTING
315
4:blob:right/c:$(git rev-parse topic:right/c)
293
- 5:tree:left/:$(git rev-parse base~1:left)
294
- 6:blob:left/b:$(git rev-parse base~1:left/b)
295
- 7:blob:a:$(git rev-parse base~1:a)
316
+ 5:tree:left/:$(git rev-parse base~1:left):UNINTERESTING
317
+ 6:blob:left/b:$(git rev-parse base~1:left/b):UNINTERESTING
318
+ 7:blob:a:$(git rev-parse base~1:a):UNINTERESTING
319
blobs:5
320
commits:2
321
tags:0
325
test_cmp_sorted expect out
326
'
327
328
+test_expect_success 'topic, not base, boundary with pruning' '
329
+ test-tool path-walk --prune -- --boundary topic --not base >out &&
330
+
331
+ cat >expect <<-EOF &&
332
+ 0:commit::$(git rev-parse topic)
333
+ 0:commit::$(git rev-parse base~1):UNINTERESTING
334
+ 1:tree::$(git rev-parse topic^{tree})
335
+ 1:tree::$(git rev-parse base~1^{tree}):UNINTERESTING
336
+ 2:tree:right/:$(git rev-parse topic:right)
337
+ 2:tree:right/:$(git rev-parse base~1:right):UNINTERESTING
338
+ 3:blob:right/c:$(git rev-parse base~1:right/c):UNINTERESTING
339
+ 3:blob:right/c:$(git rev-parse topic:right/c)
340
+ blobs:2
341
+ commits:2
342
+ tags:0
343
+ trees:4
344
+ EOF
345
+
346
+ test_cmp_sorted expect out
347
+'
348
+
349
test_expect_success 'trees are reported exactly once' '
350
test_when_finished "rm -rf unique-trees" &&
351
test_create_repo unique-trees &&
353
cd unique-trees &&
354
mkdir initial &&
355
test_commit initial/file &&
312
-
356
git switch -c move-to-top &&
357
git mv initial/file.t ./ &&
358
test_tick &&
359
git commit -m moved &&
317
-
360
git update-ref refs/heads/other HEAD
361
) &&
320
-
362
test-tool -C unique-trees path-walk -- --all >out &&
363
tree=$(git -C unique-trees rev-parse HEAD:) &&
364
grep "$tree" out >out-filtered &&