Skip to content

Commit 5a4381f

Browse files
ttaylorrgitster
authored andcommitted
t7704: demonstrate failure with once-cruft objects above the geometric split
Add a test demonstrating a case where geometric repacking fails to produce a pack with full object closure, thus making it impossible to write a reachability bitmap. Mark the test with 'test_expect_failure' for now. The subsequent commit will explain the precise failure mode, and implement a fix. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent d31d1f2 commit 5a4381f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

t/t7704-repack-cruft.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,4 +869,26 @@ test_expect_success 'repack --write-midx includes cruft when already geometric'
869869
)
870870
'
871871

872+
test_expect_failure 'repack rescues once-cruft objects above geometric split' '
873+
git config repack.midxMustContainCruft false &&
874+
875+
test_commit reachable &&
876+
test_commit unreachable &&
877+
878+
unreachable="$(git rev-parse HEAD)" &&
879+
880+
git reset --hard HEAD^ &&
881+
git tag -d unreachable &&
882+
git reflog expire --all --expire=all &&
883+
884+
git repack --cruft -d &&
885+
886+
echo $unreachable | git pack-objects .git/objects/pack/pack &&
887+
888+
test_commit new &&
889+
890+
git update-ref refs/heads/other $unreachable &&
891+
git repack --geometric=2 -d --write-midx --write-bitmap-index
892+
'
893+
872894
test_done

0 commit comments

Comments
 (0)