@@ -209,31 +209,54 @@ test_expect_success 'topic, not base' '
209
209
COMMIT::$(git rev-parse topic)
210
210
commits:1
211
211
TREE::$(git rev-parse topic^{tree})
212
- TREE:left/:$(git rev-parse topic :left)
212
+ TREE:left/:$(git rev-parse base~1 :left):UNINTERESTING
213
213
TREE:right/:$(git rev-parse topic:right)
214
214
trees:3
215
- BLOB:a:$(git rev-parse topic :a)
216
- BLOB:left/b:$(git rev-parse topic :left/b)
215
+ BLOB:a:$(git rev-parse base~1 :a):UNINTERESTING
216
+ BLOB:left/b:$(git rev-parse base~1 :left/b):UNINTERESTING
217
217
BLOB:right/c:$(git rev-parse topic:right/c)
218
- BLOB:right/d:$(git rev-parse topic :right/d)
218
+ BLOB:right/d:$(git rev-parse base~1 :right/d):UNINTERESTING
219
219
blobs:4
220
220
tags:0
221
221
EOF
222
222
223
223
test_cmp_sorted expect out
224
224
'
225
225
226
+ test_expect_success ' fourth, blob-tag2, not base' '
227
+ test-tool path-walk -- fourth blob-tag2 --not base >out &&
228
+
229
+ cat >expect <<-EOF &&
230
+ COMMIT::$(git rev-parse topic)
231
+ commits:1
232
+ TREE::$(git rev-parse topic^{tree})
233
+ TREE:left/:$(git rev-parse base~1:left):UNINTERESTING
234
+ TREE:right/:$(git rev-parse topic:right)
235
+ trees:3
236
+ BLOB:a:$(git rev-parse base~1:a):UNINTERESTING
237
+ BLOB:left/b:$(git rev-parse base~1:left/b):UNINTERESTING
238
+ BLOB:right/c:$(git rev-parse topic:right/c)
239
+ BLOB:right/d:$(git rev-parse base~1:right/d):UNINTERESTING
240
+ BLOB:/tagged-blobs:$(git rev-parse refs/tags/blob-tag2^{})
241
+ blobs:5
242
+ TAG:/tags:$(git rev-parse fourth)
243
+ tags:1
244
+ EOF
245
+
246
+ test_cmp_sorted expect out
247
+ '
248
+
226
249
test_expect_success ' topic, not base, only blobs' '
227
250
test-tool path-walk --no-trees --no-commits \
228
251
-- topic --not base >out &&
229
252
230
253
cat >expect <<-EOF &&
231
254
commits:0
232
255
trees:0
233
- BLOB:a:$(git rev-parse topic :a)
234
- BLOB:left/b:$(git rev-parse topic :left/b)
256
+ BLOB:a:$(git rev-parse base~1 :a):UNINTERESTING
257
+ BLOB:left/b:$(git rev-parse base~1 :left/b):UNINTERESTING
235
258
BLOB:right/c:$(git rev-parse topic:right/c)
236
- BLOB:right/d:$(git rev-parse topic :right/d)
259
+ BLOB:right/d:$(git rev-parse base~1 :right/d):UNINTERESTING
237
260
blobs:4
238
261
tags:0
239
262
EOF
@@ -265,7 +288,7 @@ test_expect_success 'topic, not base, only trees' '
265
288
cat >expect <<-EOF &&
266
289
commits:0
267
290
TREE::$(git rev-parse topic^{tree})
268
- TREE:left/:$(git rev-parse topic :left)
291
+ TREE:left/:$(git rev-parse base~1 :left):UNINTERESTING
269
292
TREE:right/:$(git rev-parse topic:right)
270
293
trees:3
271
294
blobs:0
@@ -280,46 +303,45 @@ test_expect_success 'topic, not base, boundary' '
280
303
281
304
cat >expect <<-EOF &&
282
305
COMMIT::$(git rev-parse topic)
283
- COMMIT::$(git rev-parse base~1)
306
+ COMMIT::$(git rev-parse base~1):UNINTERESTING
284
307
commits:2
285
308
TREE::$(git rev-parse topic^{tree})
286
- TREE::$(git rev-parse base~1^{tree})
287
- TREE:left/:$(git rev-parse base~1:left)
309
+ TREE::$(git rev-parse base~1^{tree}):UNINTERESTING
310
+ TREE:left/:$(git rev-parse base~1:left):UNINTERESTING
288
311
TREE:right/:$(git rev-parse topic:right)
289
- TREE:right/:$(git rev-parse base~1:right)
312
+ TREE:right/:$(git rev-parse base~1:right):UNINTERESTING
290
313
trees:5
291
- BLOB:a:$(git rev-parse base~1:a)
292
- BLOB:left/b:$(git rev-parse base~1:left/b)
293
- BLOB:right/c:$(git rev-parse base~1:right/c)
314
+ BLOB:a:$(git rev-parse base~1:a):UNINTERESTING
315
+ BLOB:left/b:$(git rev-parse base~1:left/b):UNINTERESTING
316
+ BLOB:right/c:$(git rev-parse base~1:right/c):UNINTERESTING
294
317
BLOB:right/c:$(git rev-parse topic:right/c)
295
- BLOB:right/d:$(git rev-parse base~1:right/d)
318
+ BLOB:right/d:$(git rev-parse base~1:right/d):UNINTERESTING
296
319
blobs:5
297
320
tags:0
298
321
EOF
299
322
300
323
test_cmp_sorted expect out
301
324
'
302
325
303
- test_expect_success ' trees are reported exactly once' '
304
- test_when_finished "rm -rf unique-trees" &&
305
- test_create_repo unique-trees &&
306
- (
307
- cd unique-trees &&
308
- mkdir initial &&
309
- test_commit initial/file &&
310
-
311
- git switch -c move-to-top &&
312
- git mv initial/file.t ./ &&
313
- test_tick &&
314
- git commit -m moved &&
315
-
316
- git update-ref refs/heads/other HEAD
317
- ) &&
318
-
319
- test-tool -C unique-trees path-walk -- --all >out &&
320
- tree=$(git -C unique-trees rev-parse HEAD:) &&
321
- grep "$tree" out >out-filtered &&
322
- test_line_count = 1 out-filtered
326
+ test_expect_success ' topic, not base, boundary with pruning' '
327
+ test-tool path-walk --prune -- --boundary topic --not base >out &&
328
+
329
+ cat >expect <<-EOF &&
330
+ COMMIT::$(git rev-parse topic)
331
+ COMMIT::$(git rev-parse base~1):UNINTERESTING
332
+ commits:2
333
+ TREE::$(git rev-parse topic^{tree})
334
+ TREE::$(git rev-parse base~1^{tree}):UNINTERESTING
335
+ TREE:right/:$(git rev-parse topic:right)
336
+ TREE:right/:$(git rev-parse base~1:right):UNINTERESTING
337
+ trees:4
338
+ BLOB:right/c:$(git rev-parse base~1:right/c):UNINTERESTING
339
+ BLOB:right/c:$(git rev-parse topic:right/c)
340
+ blobs:2
341
+ tags:0
342
+ EOF
343
+
344
+ test_cmp_sorted expect out
323
345
'
324
346
325
347
test_done
0 commit comments