The eleventh batch
[git/gitster.git] / t / t5334-incremental-multi-pack-index.sh
blob471994c4bc89d8faa5bb39e8614439573f388ba3
1 #!/bin/sh
3 test_description='incremental multi-pack-index'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7 . "$TEST_DIRECTORY"/lib-midx.sh
9 GIT_TEST_MULTI_PACK_INDEX=0
10 export GIT_TEST_MULTI_PACK_INDEX
12 objdir=.git/objects
13 packdir=$objdir/pack
14 midxdir=$packdir/multi-pack-index.d
15 midx_chain=$midxdir/multi-pack-index-chain
17 test_expect_success 'convert non-incremental MIDX to incremental' '
18 test_commit base &&
19 git repack -ad &&
20 git multi-pack-index write &&
22 test_path_is_file $packdir/multi-pack-index &&
23 old_hash="$(midx_checksum $objdir)" &&
25 test_commit other &&
26 git repack -d &&
27 git multi-pack-index write --incremental &&
29 test_path_is_missing $packdir/multi-pack-index &&
30 test_path_is_file $midx_chain &&
31 test_line_count = 2 $midx_chain &&
32 grep $old_hash $midx_chain
35 compare_results_with_midx 'incremental MIDX'
37 test_expect_success 'convert incremental to non-incremental' '
38 test_commit squash &&
39 git repack -d &&
40 git multi-pack-index write &&
42 test_path_is_file $packdir/multi-pack-index &&
43 test_dir_is_empty $midxdir
46 compare_results_with_midx 'non-incremental MIDX conversion'
48 test_done