[PATCH 08/11] t5332: enable OFS_DELTAs via test_pack_objects_reused

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Back when test_pack_objects_reused was introduced via commit
7c01878eeb (t5332-multi-pack-reuse.sh: extract pack-objects helper
functions, 2024-02-05), we converted bare pack-objects invocations
into one of two wrapped variants, either test_pack_objects_reused or
test_pack_objects_reused_all.

The latter passes `--delta-base-offset`, allowing pack-objects to
generate OFS_DELTAs in its output pack. But the former does not, for
no good reason.

As we do not want to convert OFS_DELTAs to REF_DELTAs unnecessarily,
let's unify these two and pass `--delta-base-offset` to both.

Instrumenting the codepath
where we convert OFS_DELTAs to REF_DELTAs with a BUG() like so:

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 0fc0680b402..0f1b22b8674 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1051,6 +1051,8 @@ static void write_reused_pack_one(struct packed_git *reuse_packfile,
 			uint32_t base_pos;
 			struct object_id base_oid;

+			BUG("tested");
+
 			if (offset_to_pack_pos(reuse_packfile, base_offset, &base_pos) < 0)
 				die(_("expected object at offset %"PRIuMAX" "
 				      "in pack %s"),

, and seeing what test(s) fail yields the following.

    Test Summary Report
    -------------------
    t5326-multi-pack-bitmaps.sh                      (Wstat: 256 (exited 1) Tests: 357 Failed: 6)
      Failed tests:  46, 91, 167, 220, 265, 341
      Non-zero exit status: 1
    t5310-pack-bitmaps.sh                            (Wstat: 256 (exited 1) Tests: 227 Failed: 6)
      Failed tests:  46-47, 120-121, 197-198
      Non-zero exit status: 1
    t5327-multi-pack-bitmaps-rev.sh                  (Wstat: 256 (exited 1) Tests: 314 Failed: 6)
      Failed tests:  46, 91, 157, 203, 248, 314
      Non-zero exit status: 1

So the OFS_DELTA to REF_DELTA conversion is still tested thoroughly in
t5310, t5326, and t5327.

Signed-off-by: Taylor Blau <me@xxxxxxxxxxxx>
---
 t/t5332-multi-pack-reuse.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t5332-multi-pack-reuse.sh b/t/t5332-multi-pack-reuse.sh
index 955ea42769b..8bcb736c75a 100755
--- a/t/t5332-multi-pack-reuse.sh
+++ b/t/t5332-multi-pack-reuse.sh
@@ -43,7 +43,7 @@ test_pack_objects_reused_all () {
 test_pack_objects_reused () {
 	: >trace2.txt &&
 	GIT_TRACE2_EVENT="$PWD/trace2.txt" \
-		git pack-objects --stdout --revs >got.pack &&
+		git pack-objects --delta-base-offset --stdout --revs >got.pack &&
 
 	test_pack_reused "$1" <trace2.txt &&
 	test_packs_reused "$2" <trace2.txt &&
-- 
2.47.0.11.g487258bca34





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux