Skip to content

Commit 078eecb

Browse files
peffgitster
authored andcommitted
t5312: test non-destructive repack
In t5312, we create a state with a broken ref, and then make sure that destructive repacks don't silently ignore the breakage (where a destructive repack is one that might drop objects). But we don't check the behavior of non-destructive repacks at all (i.e., ones where we'd keep unreachable objects). So let's add a test to confirm the current behavior, which is that they are allowed (i.e., ignoring the breakage and considering any objects it points to as unreachable). This may change in the future, but we'd like for the test suite to alert us to that fact. Signed-off-by: Jeff King <[email protected]> Reviewed-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f805844 commit 078eecb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

t/t5312-prune-corruption.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ test_expect_success 'put bogus object into pack' '
4646
git cat-file -e $bogus
4747
'
4848

49+
test_expect_success 'non-destructive repack ignores bogus name' '
50+
create_bogus_ref &&
51+
git repack -adk
52+
'
53+
4954
test_expect_success 'destructive repack keeps packed object' '
5055
create_bogus_ref &&
5156
test_might_fail git repack -Ad --unpack-unreachable=now &&

0 commit comments

Comments
 (0)