@@ -277,6 +277,10 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr
277277'
278278
279279# Test sparse:path=<path> filter.
280+ # !!!!
281+ # NOTE: sparse:path filter support has been dropped for security reasons,
282+ # so the tests have been changed to make sure that using it fails.
283+ # !!!!
280284# Use a local file containing a sparse-checkout specification to filter
281285# out blobs not required for the corresponding sparse-checkout. We do not
282286# require sparse-checkout to actually be enabled.
@@ -315,73 +319,24 @@ test_expect_success 'verify blob count in normal packfile' '
315319 test_cmp expected observed
316320'
317321
318- test_expect_success ' verify sparse:path=pattern1' '
319- git -C r3 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&
320- awk -f print_2.awk ls_files_result |
321- sort >expected &&
322-
323- git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&
322+ test_expect_success ' verify sparse:path=pattern1 fails' '
323+ test_must_fail git -C r3 pack-objects --revs --stdout \
324+ --filter=sparse:path=../pattern1 <<-EOF
324325 HEAD
325326 EOF
326- git -C r3 index-pack ../filter.pack &&
327-
328- git -C r3 verify-pack -v ../filter.pack >verify_result &&
329- grep blob verify_result |
330- awk -f print_1.awk |
331- sort >observed &&
332-
333- test_cmp expected observed
334- '
335-
336- test_expect_success ' verify normal and sparse:path=pattern1 packfiles have same commits/trees' '
337- git -C r3 verify-pack -v ../all.pack >verify_result &&
338- grep -E "commit|tree" verify_result |
339- awk -f print_1.awk |
340- sort >expected &&
341-
342- git -C r3 verify-pack -v ../filter.pack >verify_result &&
343- grep -E "commit|tree" verify_result |
344- awk -f print_1.awk |
345- sort >observed &&
346-
347- test_cmp expected observed
348327'
349328
350- test_expect_success ' verify sparse:path=pattern2' '
351- git -C r3 ls-files -s sparse1 dir1/sparse1 >ls_files_result &&
352- awk -f print_2.awk ls_files_result |
353- sort >expected &&
354-
355- git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&
329+ test_expect_success ' verify sparse:path=pattern2 fails' '
330+ test_must_fail git -C r3 pack-objects --revs --stdout \
331+ --filter=sparse:path=../pattern2 <<-EOF
356332 HEAD
357333 EOF
358- git -C r3 index-pack ../filter.pack &&
359-
360- git -C r3 verify-pack -v ../filter.pack >verify_result &&
361- grep blob verify_result |
362- awk -f print_1.awk |
363- sort >observed &&
364-
365- test_cmp expected observed
366- '
367-
368- test_expect_success ' verify normal and sparse:path=pattern2 packfiles have same commits/trees' '
369- git -C r3 verify-pack -v ../all.pack >verify_result &&
370- grep -E "commit|tree" verify_result |
371- awk -f print_1.awk |
372- sort >expected &&
373-
374- git -C r3 verify-pack -v ../filter.pack >verify_result &&
375- grep -E "commit|tree" verify_result |
376- awk -f print_1.awk |
377- sort >observed &&
378-
379- test_cmp expected observed
380334'
381335
382336# Test sparse:oid=<oid-ish> filter.
383- # Like sparse:path, but we get the sparse-checkout specification from
384- # a blob rather than a file on disk.
337+ # Use a blob containing a sparse-checkout specification to filter
338+ # out blobs not required for the corresponding sparse-checkout. We do not
339+ # require sparse-checkout to actually be enabled.
385340
386341test_expect_success ' setup r4' '
387342 git init r4 &&
0 commit comments