Skip to content

Commit cfcfd5b

Browse files
pks-tgitster
authored andcommitted
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>
1 parent bc77fc6 commit cfcfd5b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

t/t7900-maintenance.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ test_expect_success 'help text' '
4343
test_grep "usage: git maintenance" err
4444
'
4545

46-
test_expect_success 'run [--auto|--quiet]' '
46+
test_expect_success 'run [--auto|--quiet] with gc strategy' '
47+
test_config maintenance.strategy gc &&
4748
GIT_TRACE2_EVENT="$(pwd)/run-no-auto.txt" \
4849
git maintenance run 2>/dev/null &&
4950
GIT_TRACE2_EVENT="$(pwd)/run-auto.txt" \
@@ -497,6 +498,7 @@ test_expect_success 'maintenance.incremental-repack.auto' '
497498
(
498499
cd incremental-repack-true &&
499500
git config core.multiPackIndex true &&
501+
git config maintenance.auto false &&
500502
run_incremental_repack_and_verify
501503
)
502504
'
@@ -507,6 +509,7 @@ test_expect_success 'maintenance.incremental-repack.auto (when config is unset)'
507509
(
508510
cd incremental-repack-unset &&
509511
test_unconfig core.multiPackIndex &&
512+
git config maintenance.auto false &&
510513
run_incremental_repack_and_verify
511514
)
512515
'
@@ -617,6 +620,7 @@ test_expect_success 'geometric repacking with --auto' '
617620
git init repo &&
618621
(
619622
cd repo &&
623+
git config set maintenance.auto false &&
620624
621625
# An empty repository does not need repacking, except when
622626
# explicitly told to do it.

0 commit comments

Comments
 (0)