Skip to content

Commit b494b1c

Browse files
ttaylorrgitster
authored andcommitted
t/t7700-repack.sh: fix test breakages with GIT_TEST_MULTI_PACK_INDEX=1
There are a handful of related test breakages which are found when running t/t7700-repack.sh with GIT_TEST_MULTI_PACK_INDEX set to "1" in your environment. Both test failures are the result of something like: git repack --write-midx --write-bitmap-index [...] && test_path_is_file $midx && test_path_is_file $midx-$(midx_checksum $objdir).bitmap , where we repack instructing Git to write a new MIDX and corresponding MIDX bitamp. The error occurs when GIT_TEST_MULTI_PACK_INDEX=1 is found in the enviornment. This causes Git to write out a second MIDX (after processing the builtin's `--write-midx` argument) which is identical to the first, but does not request a bitmap (since we did not set the GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP variable in the environment). Since c528e17 (pack-bitmap: write multi-pack bitmaps, 2021-08-31), the MIDX machinery will drop an existing MIDX bitmap when rewriting an identical MIDX which does not itself request a corresponding bitmap, which is similar to the way repack itself behaves in the pack-bitmap case. Correct these issues (which date back to [1] and [2], respectively) by explicitly setting GIT_TEST_MULTI_PACK_INDEX to zero before running each command. In the future, we should consider removing GIT_TEST_MULTI_PACK_INDEX, and in general clean up unused GIT_TEST_-variables. But that is a larger effort, and this ensures that we can cleanly run: $ GIT_TEST_MULTI_PACK_INDEX=1 make test in the meantime. [1]: 324efc9 (builtin/repack.c: pass `--refs-snapshot` when writing bitmaps, 2021-10-01) [2]: 197443e (repack: don't remove .keep packs with `--pack-kept-objects`, 2022-10-17). Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c2cbfbd commit b494b1c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

t/t7700-repack.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ test_expect_success '--write-midx with preferred bitmap tips' '
629629
git log --format="create refs/tags/%s/%s %H" HEAD >refs &&
630630
git update-ref --stdin <refs &&
631631
632+
GIT_TEST_MULTI_PACK_INDEX=0 \
632633
git repack --write-midx --write-bitmap-index &&
633634
test_path_is_file $midx &&
634635
test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
@@ -749,6 +750,7 @@ test_expect_success '--write-midx with --pack-kept-objects' '
749750
keep="$objdir/pack/pack-$one.keep" &&
750751
touch "$keep" &&
751752
753+
GIT_TEST_MULTI_PACK_INDEX=0 \
752754
git repack --write-midx --write-bitmap-index --geometric=2 -d \
753755
--pack-kept-objects &&
754756

0 commit comments

Comments
 (0)