3 test_description
='test index-pack handling of delta cycles in packfiles'
5 .
"$TEST_DIRECTORY"/lib-pack.sh
7 # Two similar-ish objects that we have computed deltas between.
8 A
=01d7713666f4de822776c7622c10f1b07de280dc
9 B
=e68fe8129b546b101aee9510c5328e7f21ca1d18
11 # double-check our hand-constucted packs
12 test_expect_success
'index-pack works with a single delta (A->B)' '
19 pack_trailer ab.pack &&
20 git index-pack --stdin <ab.pack &&
25 test_expect_success
'index-pack works with a single delta (B->A)' '
32 pack_trailer ba.pack &&
33 git index-pack --stdin <ba.pack &&
38 test_expect_success
'index-pack detects missing base objects' '
44 pack_trailer missing.pack &&
45 test_must_fail git index-pack --fix-thin --stdin <missing.pack
48 test_expect_success
'index-pack detects REF_DELTA cycles' '
55 pack_trailer cycle.pack &&
56 test_must_fail git index-pack --fix-thin --stdin <cycle.pack
59 test_expect_failure
'failover to an object in another pack' '
61 git index-pack --stdin <ab.pack &&
62 git index-pack --stdin --fix-thin <cycle.pack
65 test_expect_failure
'failover to a duplicate object in the same pack' '
72 } >recoverable.pack &&
73 pack_trailer recoverable.pack &&
74 git index-pack --fix-thin --stdin <recoverable.pack