t: disable maintenance where we verify object database structure

We have a couple of tests that explicitly verify the structure of the
object database. Naturally, this structure is dependent on whether or
not we run repository maintenance: if it decides to optimize the object
database the expected structure is likely to not materialize.

Explicitly disable auto-maintenance in such tests so that we are not
dependent on decisions made by our maintenance.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2026-02-24 09:45:46 +01:00
committed by Junio C Hamano
parent 09505b1115
commit 5e6c612720
11 changed files with 17 additions and 3 deletions

View File

@@ -68,6 +68,7 @@ test_expect_success 'add more packfiles' '
'
test_expect_success 'add more commits (as loose objects)' '
test_config maintenance.auto false &&
test_commit six &&
test_commit seven &&

View File

@@ -48,6 +48,7 @@ test_description='pack-objects breaks long cross-pack delta chains'
# repeatedly-modified file to generate the delta chain).
test_expect_success 'create series of packs' '
test_config maintenance.auto false &&
test-tool genrandom foo 4096 >content &&
prev= &&
for i in $(test_seq 1 10)

View File

@@ -1315,6 +1315,7 @@ test_expect_success 'bitmapped packs are stored via the BTMP chunk' '
git init repo &&
(
cd repo &&
git config set maintenance.auto false &&
for i in 1 2 3 4 5
do

View File

@@ -93,7 +93,8 @@ test_midx_bitmap_cases () {
test_expect_success 'setup test_repository' '
rm -rf * .git &&
git init &&
git config pack.writeBitmapLookupTable '"$writeLookupTable"'
git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
git config maintenance.auto false
'
midx_bitmap_core

View File

@@ -30,7 +30,8 @@ test_midx_bitmap_rev () {
test_expect_success 'setup bitmap config' '
rm -rf * .git &&
git init &&
git config pack.writeBitmapLookupTable '"$writeLookupTable"'
git config pack.writeBitmapLookupTable '"$writeLookupTable"' &&
git config maintenance.auto false
'
midx_bitmap_core rev

View File

@@ -14,6 +14,7 @@ packed_objects () {
test_expect_success 'setup for --stdin-packs tests' '
git init stdin-packs &&
git -C stdin-packs config set maintenance.auto false &&
(
cd stdin-packs &&
@@ -255,6 +256,7 @@ test_expect_success '--stdin-packs=follow walks into unknown packs' '
git init repo &&
(
cd repo &&
git config set maintenance.auto false &&
for c in A B C D
do

View File

@@ -59,6 +59,7 @@ test_pack_objects_reused () {
test_expect_success 'preferred pack is reused for single-pack reuse' '
test_config pack.allowPackReuse single &&
git config set maintenance.auto false &&
for i in A B
do

View File

@@ -15,6 +15,7 @@ midx_chain=$midxdir/multi-pack-index-chain
test_expect_success 'convert non-incremental MIDX to incremental' '
test_commit base &&
git config set maintenance.auto false &&
git repack -ad &&
git multi-pack-index write &&

View File

@@ -154,7 +154,8 @@ test_expect_success 'clone shallow depth 1 with fsck' '
'
test_expect_success 'clone shallow' '
git clone --no-single-branch --depth 2 "file://$(pwd)/." shallow
git clone --no-single-branch --depth 2 "file://$(pwd)/." shallow &&
git -C shallow config set maintenance.auto false
'
test_expect_success 'clone shallow depth count' '

View File

@@ -585,6 +585,7 @@ test_expect_success 'verify fetch downloads only one pack when updating refs' '
git clone --filter=blob:none "file://$(pwd)/srv.bare" pack-test &&
ls pack-test/.git/objects/pack/*pack >pack-list &&
test_line_count = 2 pack-list &&
test_config -C pack-test maintenance.auto false &&
for i in A B C
do
test_commit -C src $i &&

View File

@@ -217,6 +217,7 @@ test_expect_success 'repack --keep-pack' '
cd keep-pack &&
# avoid producing different packs due to delta/base choices
git config pack.window 0 &&
git config maintenance.auto false &&
P1=$(commit_and_pack 1) &&
P2=$(commit_and_pack 2) &&
P3=$(commit_and_pack 3) &&
@@ -260,6 +261,7 @@ test_expect_success 'repacking fails when missing .pack actually means missing o
# Avoid producing different packs due to delta/base choices
git config pack.window 0 &&
git config maintenance.auto false &&
P1=$(commit_and_pack 1) &&
P2=$(commit_and_pack 2) &&
P3=$(commit_and_pack 3) &&
@@ -534,6 +536,7 @@ test_expect_success 'setup for --write-midx tests' '
(
cd midx &&
git config core.multiPackIndex true &&
git config maintenance.auto false &&
test_commit base
)