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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Nov 29, 2022 at 13:22 UTC f00d81153336e1d560288c5f698aada3ca507dba
1 file changed +38
t/t5317-pack-objects-filter-objects.sh
+38
@@ -265,6 +265,44 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr
265 test_cmp expected observed
266 '
267
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 +
306 # Test sparse:path=<path> filter.
307 # !!!!
308 # NOTE: sparse:path filter support has been dropped for security reasons,