t7700: update to work with MIDX bitmap test knob

A number of these tests are focused only on pack-based bitmaps and need to be updated to disable 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP' where necessary. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Taylor Blau committed Aug 31, 2021 at 16:52 UTC 4b58b6f7b70576ba89eee8fab70b254bf0bb6180
1 file changed +12 -6
t/t7700-repack.sh
+12 -6
@@ -63,13 +63,14 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
63
64 test_expect_success 'writing bitmaps via command-line can duplicate .keep objects' '
65 # build on $oid, $packid, and .keep state from previous
66 - git repack -Adbl &&
66 + GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 git repack -Adbl &&
67 test_has_duplicate_object true
68 '
69
70 test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
71 # build on $oid, $packid, and .keep state from previous
72 - git -c repack.writebitmaps=true repack -Adl &&
72 + GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
73 + git -c repack.writebitmaps=true repack -Adl &&
74 test_has_duplicate_object true
75 '
76
@@ -189,7 +190,9 @@ test_expect_success 'repack --keep-pack' '
190
191 test_expect_success 'bitmaps are created by default in bare repos' '
192 git clone --bare .git bare.git &&
192 - git -C bare.git repack -ad &&
193 + rm -f bare.git/objects/pack/*.bitmap &&
194 + GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
195 + git -C bare.git repack -ad &&
196 bitmap=$(ls bare.git/objects/pack/*.bitmap) &&
197 test_path_is_file "$bitmap"
198 '
@@ -200,7 +203,8 @@ test_expect_success 'incremental repack does not complain' '
203 '
204
205 test_expect_success 'bitmaps can be disabled on bare repos' '
203 - git -c repack.writeBitmaps=false -C bare.git repack -ad &&
206 + GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
207 + git -c repack.writeBitmaps=false -C bare.git repack -ad &&
208 bitmap=$(ls bare.git/objects/pack/*.bitmap || :) &&
209 test -z "$bitmap"
210 '
@@ -211,7 +215,8 @@ test_expect_success 'no bitmaps created if .keep files present' '
215 keep=${pack%.pack}.keep &&
216 test_when_finished "rm -f \"\$keep\"" &&
217 >"$keep" &&
214 - git -C bare.git repack -ad 2>stderr &&
218 + GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
219 + git -C bare.git repack -ad 2>stderr &&
220 test_must_be_empty stderr &&
221 find bare.git/objects/pack/ -type f -name "*.bitmap" >actual &&
222 test_must_be_empty actual
@@ -222,7 +227,8 @@ test_expect_success 'auto-bitmaps do not complain if unavailable' '
227 blob=$(test-tool genrandom big $((1024*1024)) |
228 git -C bare.git hash-object -w --stdin) &&
229 git -C bare.git update-ref refs/tags/big $blob &&
225 - git -C bare.git repack -ad 2>stderr &&
230 + GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
231 + git -C bare.git repack -ad 2>stderr &&
232 test_must_be_empty stderr &&
233 find bare.git/objects/pack -type f -name "*.bitmap" >actual &&
234 test_must_be_empty actual