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 <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Derrick Stolee committed
Aug 20, 2018 at 16:52 UTC
e9ab2ed7de33a399b44295628e587db6a57bf897
1 file changed
+18
-3
t/t5319-multi-pack-index.sh
+18
-3
@@ -86,8 +86,14 @@ test_expect_success 'write midx with one v1 pack' '
86
'
87
88
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 &&
97
test_cmp expect actual
98
}
99
@@ -95,7 +101,10 @@ compare_results_with_midx () {
101
MSG=$1
102
test_expect_success "check normal git operations: $MSG" '
103
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
108
'
109
}
110
@@ -149,6 +158,12 @@ test_expect_success 'repack removes multi-pack-index' '
158
159
compare_results_with_midx "after repack"
160
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
+
167
test_expect_success 'multi-pack-index and alternates' '
168
git init --bare alt.git &&
169
echo $(pwd)/alt.git/objects >.git/objects/info/alternates &&