(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'test index-pack handling of delta cycles in packfiles'>)} spids: [4] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (C {<.>} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) <'/lib-pack.sh'>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:A) op: assign_op.Equal rhs: {<01d7713666f4de822776c7622c10f1b07de280dc>} spids: [24] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:B) op: assign_op.Equal rhs: {<e68fe8129b546b101aee9510c5328e7f21ca1d18>} spids: [27] ) ] ) (C {<test_expect_success>} {(SQ <'index-pack works with a single delta (A->B)'>)} { (SQ <'\n'> <'\tclear_packs &&\n'> <'\t{\n'> <'\t\tpack_header 2 &&\n'> <'\t\tpack_obj $A $B &&\n'> <'\t\tpack_obj $B\n'> <'\t} >ab.pack &&\n'> <'\tpack_trailer ab.pack &&\n'> <'\tgit index-pack --stdin <ab.pack &&\n'> <'\tgit cat-file -t $A &&\n'> <'\tgit cat-file -t $B\n'> ) } ) (C {<test_expect_success>} {(SQ <'index-pack works with a single delta (B->A)'>)} { (SQ <'\n'> <'\tclear_packs &&\n'> <'\t{\n'> <'\t\tpack_header 2 &&\n'> <'\t\tpack_obj $A &&\n'> <'\t\tpack_obj $B $A\n'> <'\t} >ba.pack &&\n'> <'\tpack_trailer ba.pack &&\n'> <'\tgit index-pack --stdin <ba.pack &&\n'> <'\tgit cat-file -t $A &&\n'> <'\tgit cat-file -t $B\n'> ) } ) (C {<test_expect_success>} {(SQ <'index-pack detects missing base objects'>)} { (SQ <'\n'> <'\tclear_packs &&\n'> <'\t{\n'> <'\t\tpack_header 1 &&\n'> <'\t\tpack_obj $A $B\n'> <'\t} >missing.pack &&\n'> <'\tpack_trailer missing.pack &&\n'> <'\ttest_must_fail git index-pack --fix-thin --stdin <missing.pack\n'> ) } ) (C {<test_expect_success>} {(SQ <'index-pack detects REF_DELTA cycles'>)} { (SQ <'\n'> <'\tclear_packs &&\n'> <'\t{\n'> <'\t\tpack_header 2 &&\n'> <'\t\tpack_obj $A $B &&\n'> <'\t\tpack_obj $B $A\n'> <'\t} >cycle.pack &&\n'> <'\tpack_trailer cycle.pack &&\n'> <'\ttest_must_fail git index-pack --fix-thin --stdin <cycle.pack\n'> ) } ) (C {<test_expect_failure>} {(SQ <'failover to an object in another pack'>)} { (SQ <'\n'> <'\tclear_packs &&\n'> <'\tgit index-pack --stdin <ab.pack &&\n'> <'\tgit index-pack --stdin --fix-thin <cycle.pack\n'> ) } ) (C {<test_expect_failure>} {(SQ <'failover to a duplicate object in the same pack'>)} { (SQ <'\n'> <'\tclear_packs &&\n'> <'\t{\n'> <'\t\tpack_header 3 &&\n'> <'\t\tpack_obj $A $B &&\n'> <'\t\tpack_obj $B $A &&\n'> <'\t\tpack_obj $A\n'> <'\t} >recoverable.pack &&\n'> <'\tpack_trailer recoverable.pack &&\n'> <'\tgit index-pack --fix-thin --stdin <recoverable.pack\n'> ) } ) (C {<test_done>}) ] )