Skip to content

Commit f00d811

Browse files
rscharfegitster
authored andcommitted
t5317: demonstrate failure to handle multiple --filter options
git pack-objects should accept multiple --filter options as documented in Documentation/rev-list-options.txt, but currently the last one wins. Show that using tests with multiple blob size limits Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3f75a6e commit f00d811

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

t/t5317-pack-objects-filter-objects.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,44 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr
265265
test_cmp expected observed
266266
'
267267

268+
test_expect_failure 'verify small limit and big limit results in small limit' '
269+
git -C r2 ls-files -s large.1000 >ls_files_result &&
270+
test_parse_ls_files_stage_oids <ls_files_result |
271+
sort >expected &&
272+
273+
git -C r2 pack-objects --revs --stdout --filter=blob:limit=1001 \
274+
--filter=blob:limit=10001 >filter.pack <<-EOF &&
275+
HEAD
276+
EOF
277+
git -C r2 index-pack ../filter.pack &&
278+
279+
git -C r2 verify-pack -v ../filter.pack >verify_result &&
280+
grep blob verify_result |
281+
parse_verify_pack_blob_oid |
282+
sort >observed &&
283+
284+
test_cmp expected observed
285+
'
286+
287+
test_expect_success 'verify big limit and small limit results in small limit' '
288+
git -C r2 ls-files -s large.1000 >ls_files_result &&
289+
test_parse_ls_files_stage_oids <ls_files_result |
290+
sort >expected &&
291+
292+
git -C r2 pack-objects --revs --stdout --filter=blob:limit=10001 \
293+
--filter=blob:limit=1001 >filter.pack <<-EOF &&
294+
HEAD
295+
EOF
296+
git -C r2 index-pack ../filter.pack &&
297+
298+
git -C r2 verify-pack -v ../filter.pack >verify_result &&
299+
grep blob verify_result |
300+
parse_verify_pack_blob_oid |
301+
sort >observed &&
302+
303+
test_cmp expected observed
304+
'
305+
268306
# Test sparse:path=<path> filter.
269307
# !!!!
270308
# NOTE: sparse:path filter support has been dropped for security reasons,

0 commit comments

Comments
 (0)