From bbc393a9f3acc689f611fd602499064a2fe27d1a Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Tue, 27 Aug 2024 17:13:27 -0400 Subject: [PATCH] t/t5332-multi-pack-reuse.sh: verify pack generation with --strict In our tests for multi-pack reuse, we have two helper functions: - test_pack_objects_reused_all(), and - test_pack_objects_reused() which invoke pack-objects (either with `--all`, or the supplied tips via stdin, respectively) and ensure that (a) the number of reused objects, and (b) the number of packs which those objects were reused from both match the expected values. Both functions discard the output of pack-objects and assert only on the contents of the trace2 stream. However, if we store the pack and attempt to index it with `--strict`, we find that a number of our tests are broken, indicating a bug within multi-pack reuse. That bug will be addressed in a subsequent commit. But let's first harden these tests by trying to index the resulting pack, marking the tests which fail appropriately. Signed-off-by: Taylor Blau Signed-off-by: Junio C Hamano --- t/t5332-multi-pack-reuse.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/t/t5332-multi-pack-reuse.sh b/t/t5332-multi-pack-reuse.sh index 941e73d354..ba888a83d5 100755 --- a/t/t5332-multi-pack-reuse.sh +++ b/t/t5332-multi-pack-reuse.sh @@ -31,20 +31,24 @@ test_pack_objects_reused_all () { : >trace2.txt && GIT_TRACE2_EVENT="$PWD/trace2.txt" \ git pack-objects --stdout --revs --all --delta-base-offset \ - >/dev/null && + >got.pack && test_pack_reused "$1" test_pack_objects_reused () { : >trace2.txt && GIT_TRACE2_EVENT="$PWD/trace2.txt" \ - git pack-objects --stdout --revs >/dev/null && + git pack-objects --stdout --revs >got.pack && test_pack_reused "$1" in <<-EOF && $(git rev-parse $base) ^$(git rev-parse $delta) -- 2.47.3