]>
git.ipfire.org Git - thirdparty/git.git/blob - t/t5319-multi-pack-index.sh
3 test_description
='multi-pack-indexes'
9 header: 4d494458 1 0 $NUM_PACKS
12 test-tool read-midx .
>actual
&&
13 test_cmp expect actual
16 test_expect_success
'write midx with no packs' '
17 test_when_finished rm -f pack/multi-pack-index &&
18 git multi-pack-index --object-dir=. write &&
24 iii
=$
(printf '%03i' $i)
26 test-tool genrandom
"bar" 200 &&
27 test-tool genrandom
"baz $iii" 50
30 test-tool genrandom
"foo"$i 100 &&
31 test-tool genrandom
"foo"$
(( $i + 1 )) 100 &&
32 test-tool genrandom
"foo"$
(( $i + 2 )) 100
36 test-tool genrandom
"$iii" 8192
38 git update-index
--add file_
$iii deep_delta_
$iii wide_delta_
$iii
41 commit_and_list_objects
() {
44 test-tool genrandom
100 8192;
46 git update-index
--add file_101
&&
47 tree
=$
(git write-tree
) &&
48 commit
=$
(git commit-tree
$tree -p HEAD
</dev
/null
) &&
51 git ls-tree
$tree |
sed -e "s/.* \\([0-9a-f]*\\) .*/\\1/"
53 git
reset --hard $commit
56 test_expect_success
'create objects' '
57 test_commit initial &&
58 for i in $(test_seq 1 5)
62 commit_and_list_objects
65 test_expect_success
'write midx with one v1 pack' '
66 pack=$(git pack-objects --index-version=1 pack/test <obj-list) &&
67 test_when_finished rm pack/test-$pack.pack pack/test-$pack.idx pack/multi-pack-index &&
68 git multi-pack-index --object-dir=. write &&
72 test_expect_success
'write midx with one v2 pack' '
73 git pack-objects --index-version=2,0x40 pack/test <obj-list &&
74 git multi-pack-index --object-dir=. write &&
78 test_expect_success
'add more objects' '
79 for i in $(test_seq 6 10)
83 commit_and_list_objects
86 test_expect_success
'write midx with two packs' '
87 git pack-objects --index-version=1 pack/test-2 <obj-list &&
88 git multi-pack-index --object-dir=. write &&
92 test_expect_success
'add more packs' '
93 for j in $(test_seq 11 20)
95 generate_objects $j &&
96 commit_and_list_objects &&
97 git pack-objects --index-version=2 pack/test-pack <obj-list
101 test_expect_success
'write midx with twelve packs' '
102 git multi-pack-index --object-dir=. write &&