Skip to content

Commit e9ab2ed

Browse files
derrickstoleegitster
authored andcommitted
midx: test a few commands that use get_all_packs
The new get_all_packs() method exposed the packfiles coverede by a multi-pack-index. Before, the 'git cat-file --batch' and 'git count-objects' commands would skip objects in an environment with a multi-pack-index. Further, a reachability bitmap would be ignored if its pack-file was covered by a multi-pack-index. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 454ea2e commit e9ab2ed

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

t/t5319-multi-pack-index.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,25 @@ test_expect_success 'write midx with one v1 pack' '
8686
'
8787

8888
midx_git_two_modes () {
89-
git -c core.multiPackIndex=false $1 >expect &&
90-
git -c core.multiPackIndex=true $1 >actual &&
89+
if [ "$2" = "sorted" ]
90+
then
91+
git -c core.multiPackIndex=false $1 | sort >expect &&
92+
git -c core.multiPackIndex=true $1 | sort >actual
93+
else
94+
git -c core.multiPackIndex=false $1 >expect &&
95+
git -c core.multiPackIndex=true $1 >actual
96+
fi &&
9197
test_cmp expect actual
9298
}
9399

94100
compare_results_with_midx () {
95101
MSG=$1
96102
test_expect_success "check normal git operations: $MSG" '
97103
midx_git_two_modes "rev-list --objects --all" &&
98-
midx_git_two_modes "log --raw"
104+
midx_git_two_modes "log --raw" &&
105+
midx_git_two_modes "count-objects --verbose" &&
106+
midx_git_two_modes "cat-file --batch-all-objects --buffer --batch-check" &&
107+
midx_git_two_modes "cat-file --batch-all-objects --buffer --batch-check --unsorted" sorted
99108
'
100109
}
101110

@@ -149,6 +158,12 @@ test_expect_success 'repack removes multi-pack-index' '
149158

150159
compare_results_with_midx "after repack"
151160

161+
test_expect_success 'multi-pack-index and pack-bitmap' '
162+
git -c repack.writeBitmaps=true repack -ad &&
163+
git multi-pack-index write &&
164+
git rev-list --test-bitmap HEAD
165+
'
166+
152167
test_expect_success 'multi-pack-index and alternates' '
153168
git init --bare alt.git &&
154169
echo $(pwd)/alt.git/objects >.git/objects/info/alternates &&

0 commit comments

Comments
 (0)