@@ -209,31 +209,54 @@ test_expect_success 'topic, not base' '
209209 COMMIT::$(git rev-parse topic)
210210 commits:1
211211 TREE::$(git rev-parse topic^{tree})
212- TREE:left/:$(git rev-parse topic :left)
212+ TREE:left/:$(git rev-parse base~1 :left):UNINTERESTING
213213 TREE:right/:$(git rev-parse topic:right)
214214 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
217217 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
219219 blobs:4
220220 tags:0
221221 EOF
222222
223223 test_cmp_sorted expect out
224224'
225225
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+
226249test_expect_success ' topic, not base, only blobs' '
227250 test-tool path-walk --no-trees --no-commits \
228251 -- topic --not base >out &&
229252
230253 cat >expect <<-EOF &&
231254 commits:0
232255 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
235258 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
237260 blobs:4
238261 tags:0
239262 EOF
@@ -265,7 +288,7 @@ test_expect_success 'topic, not base, only trees' '
265288 cat >expect <<-EOF &&
266289 commits:0
267290 TREE::$(git rev-parse topic^{tree})
268- TREE:left/:$(git rev-parse topic :left)
291+ TREE:left/:$(git rev-parse base~1 :left):UNINTERESTING
269292 TREE:right/:$(git rev-parse topic:right)
270293 trees:3
271294 blobs:0
@@ -280,46 +303,45 @@ test_expect_success 'topic, not base, boundary' '
280303
281304 cat >expect <<-EOF &&
282305 COMMIT::$(git rev-parse topic)
283- COMMIT::$(git rev-parse base~1)
306+ COMMIT::$(git rev-parse base~1):UNINTERESTING
284307 commits:2
285308 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
288311 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
290313 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
294317 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
296319 blobs:5
297320 tags:0
298321 EOF
299322
300323 test_cmp_sorted expect out
301324'
302325
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
323345'
324346
325347test_done
0 commit comments