t7900: clean up large EXPENSIVE repository

One of the tests in t7900 is marked with EXPENSIVE because we create a repository with 2GB of data that we end up repacking. We never clean up that repository though, so we occupy the full 2GB of data until the end of the test suite. Besides clogging our disk, having an EXPENSIVE test that alters the repository's state used by subsequent tests is also a bad idea, as it can easily have an impact on the heuristics used by other maintenance tasks. Adapt the test so that we create the data in a standalone repository that we clean up at the end of the test. While at it, also disable auto-maintenance so that it does not race with our manual maintenance. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Jul 6, 2026 at 08:24 UTC aa4ee1f0a86e2a01f68af63560d94679fc8dd4f5
1 file changed +31 -25
t/t7900-maintenance.sh
+31 -25
@@ -461,36 +461,42 @@ test_expect_success 'incremental-repack task' '
461 '
462
463 test_expect_success EXPENSIVE 'incremental-repack 2g limit' '
464 - test_config core.compression 0 &&
464 + test_when_finished rm -rf expensive-repo &&
465 + git init expensive-repo &&
466 + (
467 + cd expensive-repo &&
468 + git config set core.compression 0 &&
469 + git config set maintenance.auto false &&
470
466 - for i in $(test_seq 1 5)
467 - do
468 - test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
469 - return 1
470 - done &&
471 - git add big &&
472 - git commit -qm "Add big file (1)" &&
471 + for i in $(test_seq 1 5)
472 + do
473 + test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
474 + return 1
475 + done &&
476 + git add big &&
477 + git commit -qm "Add big file (1)" &&
478
474 - # ensure any possible loose objects are in a pack-file
475 - git maintenance run --task=loose-objects &&
479 + # ensure any possible loose objects are in a pack-file
480 + git maintenance run --task=loose-objects &&
481
477 - rm big &&
478 - for i in $(test_seq 6 10)
479 - do
480 - test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
481 - return 1
482 - done &&
483 - git add big &&
484 - git commit -qm "Add big file (2)" &&
482 + rm big &&
483 + for i in $(test_seq 6 10)
484 + do
485 + test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
486 + return 1
487 + done &&
488 + git add big &&
489 + git commit -qm "Add big file (2)" &&
490
486 - # ensure any possible loose objects are in a pack-file
487 - git maintenance run --task=loose-objects &&
491 + # ensure any possible loose objects are in a pack-file
492 + git maintenance run --task=loose-objects &&
493
489 - # Now run the incremental-repack task and check the batch-size
490 - GIT_TRACE2_EVENT="$(pwd)/run-2g.txt" git maintenance run \
491 - --task=incremental-repack 2>/dev/null &&
492 - test_subcommand git multi-pack-index repack \
493 - --no-progress --batch-size=2147483647 <run-2g.txt
494 + # Now run the incremental-repack task and check the batch-size
495 + GIT_TRACE2_EVENT="$(pwd)/run-2g.txt" git maintenance run \
496 + --task=incremental-repack 2>/dev/null &&
497 + test_subcommand git multi-pack-index repack \
498 + --no-progress --batch-size=2147483647 <run-2g.txt
499 + )
500 '
501
502 run_incremental_repack_and_verify () {