aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2024-02-05 17:50:23 -0500
committerJunio C Hamano <gitster@pobox.com>2024-02-05 15:27:01 -0800
commit23c1e71369f4a5a5e5b176d77cfc9d8edf68ebec (patch)
treec607a3e02c92357e7ed9f6bd2f5f70e726ed0061 /t
parent7c01878eeb15e8dd75f0262bdfb3249c85a30a4a (diff)
downloadgit-23c1e71369f4a5a5e5b176d77cfc9d8edf68ebec.tar.xz
pack-objects: enable multi-pack reuse via `feature.experimental`
Now that multi-pack reuse is supported, enable it via the feature.experimental configuration in addition to the classic `pack.allowPackReuse`. This will allow more users to experiment with the new behavior who might not otherwise be aware of the existing `pack.allowPackReuse` configuration option. The enum with values NO_PACK_REUSE, SINGLE_PACK_REUSE, and MULTI_PACK_REUSE is defined statically in builtin/pack-objects.c's compilation unit. We could hoist that enum into a scope visible from the repository_settings struct, and then use that enum value in pack-objects. Instead, define a single int that indicates what pack-objects's default value should be to avoid additional unnecessary code movement. Though `feature.experimental` implies `pack.allowPackReuse=multi`, this can still be overridden by explicitly setting the latter configuration to either "single" or "false". Tests covering all of these cases are showin t5332. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5332-multi-pack-reuse.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t5332-multi-pack-reuse.sh b/t/t5332-multi-pack-reuse.sh
index d516062f84..b925a81d37 100755
--- a/t/t5332-multi-pack-reuse.sh
+++ b/t/t5332-multi-pack-reuse.sh
@@ -58,6 +58,22 @@ test_expect_success 'preferred pack is reused for single-pack reuse' '
test_pack_objects_reused_all 3 1
'
+test_expect_success 'multi-pack reuse is disabled by default' '
+ test_pack_objects_reused_all 3 1
+'
+
+test_expect_success 'feature.experimental implies multi-pack reuse' '
+ test_config feature.experimental true &&
+
+ test_pack_objects_reused_all 6 2
+'
+
+test_expect_success 'multi-pack reuse can be disabled with feature.experimental' '
+ test_config feature.experimental true &&
+ test_config pack.allowPackReuse single &&
+
+ test_pack_objects_reused_all 3 1
+'
test_expect_success 'enable multi-pack reuse' '
git config pack.allowPackReuse multi