t7900: prepare for switch of the default strategy

The t7900 test suite is exercising git-maintenance(1) and is thus of course heavily reliant on the exact maintenance strategy. This reliance comes in two flavors: - One test explicitly wants to verify that git-gc(1) is run as part of `git maintenance run`. This test is adapted by explicitly picking the "gc" strategy. - The other tests assume a specific shape of the object database, which is dependent on whether or not we run auto-maintenance before we come to the actual subject under test. These tests are adapted by disabling auto-maintenance. With these changes t7900 passes with both "gc" and "geometric" default strategies. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Feb 24, 2026 at 09:45 UTC d2fbe9af79148a93bbcc2fa540e21e9fe3594b65
1 file changed +5 -1
t/t7900-maintenance.sh
+5 -1
@@ -45,7 +45,8 @@ test_expect_success 'help text' '
45 test_grep "usage: git maintenance" err
46 '
47
48 -test_expect_success 'run [--auto|--quiet]' '
48 +test_expect_success 'run [--auto|--quiet] with gc strategy' '
49 + test_config maintenance.strategy gc &&
50 GIT_TRACE2_EVENT="$(pwd)/run-no-auto.txt" \
51 git maintenance run 2>/dev/null &&
52 GIT_TRACE2_EVENT="$(pwd)/run-auto.txt" \
@@ -499,6 +500,7 @@ test_expect_success 'maintenance.incremental-repack.auto' '
500 (
501 cd incremental-repack-true &&
502 git config core.multiPackIndex true &&
503 + git config maintenance.auto false &&
504 run_incremental_repack_and_verify
505 )
506 '
@@ -509,6 +511,7 @@ test_expect_success 'maintenance.incremental-repack.auto (when config is unset)'
511 (
512 cd incremental-repack-unset &&
513 test_unconfig core.multiPackIndex &&
514 + git config maintenance.auto false &&
515 run_incremental_repack_and_verify
516 )
517 '
@@ -619,6 +622,7 @@ test_expect_success 'geometric repacking with --auto' '
622 git init repo &&
623 (
624 cd repo &&
625 + git config set maintenance.auto false &&
626
627 # An empty repository does not need repacking, except when
628 # explicitly told to do it.