@@ -364,6 +364,10 @@ test_expect_success PERL 'required process filter should filter data' '
364
364
S=$(file_size test.r) &&
365
365
S2=$(file_size test2.r) &&
366
366
S3=$(file_size "testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r") &&
367
+ M=$(git hash-object test.r) &&
368
+ M2=$(git hash-object test2.r) &&
369
+ M3=$(git hash-object "testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r") &&
370
+ EMPTY=$(git hash-object /dev/null) &&
367
371
368
372
filter_git add . &&
369
373
cat >expected.log <<-EOF &&
@@ -378,14 +382,15 @@ test_expect_success PERL 'required process filter should filter data' '
378
382
test_cmp_count expected.log debug.log &&
379
383
380
384
git commit -m "test commit 2" &&
385
+ META="ref=refs/heads/master treeish=$(git rev-parse --verify master)" &&
381
386
rm -f test2.r "testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r" &&
382
387
383
388
filter_git checkout --quiet --no-progress . &&
384
389
cat >expected.log <<-EOF &&
385
390
START
386
391
init handshake complete
387
- IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
388
- IN: smudge testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
392
+ IN: smudge test2.r blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
393
+ IN: smudge testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
389
394
STOP
390
395
EOF
391
396
test_cmp_exclude_clean expected.log debug.log &&
@@ -406,10 +411,10 @@ test_expect_success PERL 'required process filter should filter data' '
406
411
cat >expected.log <<-EOF &&
407
412
START
408
413
init handshake complete
409
- IN: smudge test.r $S [OK] -- OUT: $S . [OK]
410
- IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
411
- IN: smudge test4-empty.r 0 [OK] -- OUT: 0 [OK]
412
- IN: smudge testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
414
+ IN: smudge test.r $META blob=$M $ S [OK] -- OUT: $S . [OK]
415
+ IN: smudge test2.r $META blob=$M2 $ S2 [OK] -- OUT: $S2 . [OK]
416
+ IN: smudge test4-empty.r $META blob=$EMPTY 0 [OK] -- OUT: 0 [OK]
417
+ IN: smudge testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r $META blob=$M3 $ S3 [OK] -- OUT: $S3 . [OK]
413
418
STOP
414
419
EOF
415
420
test_cmp_exclude_clean expected.log debug.log &&
@@ -519,17 +524,22 @@ test_expect_success PERL 'required process filter should process multiple packet
519
524
EOF
520
525
test_cmp_count expected.log debug.log &&
521
526
522
- rm -f *.file &&
527
+ M1="blob=$(git hash-object 1pkt_1__.file)" &&
528
+ M2="blob=$(git hash-object 2pkt_1+1.file)" &&
529
+ M3="blob=$(git hash-object 2pkt_2-1.file)" &&
530
+ M4="blob=$(git hash-object 2pkt_2__.file)" &&
531
+ M5="blob=$(git hash-object 3pkt_2+1.file)" &&
532
+ rm -f *.file debug.log &&
523
533
524
534
filter_git checkout --quiet --no-progress -- *.file &&
525
535
cat >expected.log <<-EOF &&
526
536
START
527
537
init handshake complete
528
- IN: smudge 1pkt_1__.file $(($S )) [OK] -- OUT: $(($S )) . [OK]
529
- IN: smudge 2pkt_1+1.file $(($S +1)) [OK] -- OUT: $(($S +1)) .. [OK]
530
- IN: smudge 2pkt_2-1.file $(($S*2-1)) [OK] -- OUT: $(($S*2-1)) .. [OK]
531
- IN: smudge 2pkt_2__.file $(($S*2 )) [OK] -- OUT: $(($S*2 )) .. [OK]
532
- IN: smudge 3pkt_2+1.file $(($S*2+1)) [OK] -- OUT: $(($S*2+1)) ... [OK]
538
+ IN: smudge 1pkt_1__.file $M1 $ (($S )) [OK] -- OUT: $(($S )) . [OK]
539
+ IN: smudge 2pkt_1+1.file $M2 $ (($S +1)) [OK] -- OUT: $(($S +1)) .. [OK]
540
+ IN: smudge 2pkt_2-1.file $M3 $ (($S*2-1)) [OK] -- OUT: $(($S*2-1)) .. [OK]
541
+ IN: smudge 2pkt_2__.file $M4 $ (($S*2 )) [OK] -- OUT: $(($S*2 )) .. [OK]
542
+ IN: smudge 3pkt_2+1.file $M5 $ (($S*2+1)) [OK] -- OUT: $(($S*2+1)) ... [OK]
533
543
STOP
534
544
EOF
535
545
test_cmp_exclude_clean expected.log debug.log &&
@@ -578,6 +588,10 @@ test_expect_success PERL 'process filter should restart after unexpected write f
578
588
S=$(file_size test.r) &&
579
589
S2=$(file_size test2.r) &&
580
590
SF=$(file_size smudge-write-fail.r) &&
591
+ M=$(git hash-object test.r) &&
592
+ M2=$(git hash-object test2.r) &&
593
+ MF=$(git hash-object smudge-write-fail.r) &&
594
+ rm -f debug.log &&
581
595
582
596
git add . &&
583
597
rm -f *.r &&
@@ -591,11 +605,11 @@ test_expect_success PERL 'process filter should restart after unexpected write f
591
605
cat >expected.log <<-EOF &&
592
606
START
593
607
init handshake complete
594
- IN: smudge smudge-write-fail.r $SF [OK] -- [WRITE FAIL]
608
+ IN: smudge smudge-write-fail.r blob=$MF $SF [OK] -- [WRITE FAIL]
595
609
START
596
610
init handshake complete
597
- IN: smudge test.r $S [OK] -- OUT: $S . [OK]
598
- IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
611
+ IN: smudge test.r blob=$M $S [OK] -- OUT: $S . [OK]
612
+ IN: smudge test2.r blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
599
613
STOP
600
614
EOF
601
615
test_cmp_exclude_clean expected.log debug.log &&
@@ -629,6 +643,10 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
629
643
S=$(file_size test.r) &&
630
644
S2=$(file_size test2.r) &&
631
645
SE=$(file_size error.r) &&
646
+ M=$(git hash-object test.r) &&
647
+ M2=$(git hash-object test2.r) &&
648
+ ME=$(git hash-object error.r) &&
649
+ rm -f debug.log &&
632
650
633
651
git add . &&
634
652
rm -f *.r &&
@@ -637,9 +655,9 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
637
655
cat >expected.log <<-EOF &&
638
656
START
639
657
init handshake complete
640
- IN: smudge error.r $SE [OK] -- [ERROR]
641
- IN: smudge test.r $S [OK] -- OUT: $S . [OK]
642
- IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
658
+ IN: smudge error.r blob=$ME $SE [OK] -- [ERROR]
659
+ IN: smudge test.r blob=$M $S [OK] -- OUT: $S . [OK]
660
+ IN: smudge test2.r blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
643
661
STOP
644
662
EOF
645
663
test_cmp_exclude_clean expected.log debug.log &&
@@ -665,18 +683,21 @@ test_expect_success PERL 'process filter abort stops processing of all further f
665
683
echo "error this blob and all future blobs" >abort.o &&
666
684
cp abort.o abort.r &&
667
685
686
+ M="blob=$(git hash-object abort.r)" &&
687
+ rm -f debug.log &&
668
688
SA=$(file_size abort.r) &&
669
689
670
690
git add . &&
671
691
rm -f *.r &&
672
692
693
+
673
694
# Note: This test assumes that Git filters files in alphabetical
674
695
# order ("abort.r" before "test.r").
675
696
filter_git checkout --quiet --no-progress . &&
676
697
cat >expected.log <<-EOF &&
677
698
START
678
699
init handshake complete
679
- IN: smudge abort.r $SA [OK] -- [ABORT]
700
+ IN: smudge abort.r $M $ SA [OK] -- [ABORT]
680
701
STOP
681
702
EOF
682
703
test_cmp_exclude_clean expected.log debug.log &&
@@ -727,27 +748,28 @@ test_expect_success PERL 'delayed checkout in process filter' '
727
748
) &&
728
749
729
750
S=$(file_size "$TEST_ROOT/test.o") &&
751
+ M="blob=$(git -C repo rev-parse --verify master:test.a)" &&
730
752
cat >a.exp <<-EOF &&
731
753
START
732
754
init handshake complete
733
- IN: smudge test.a $S [OK] -- OUT: $S . [OK]
734
- IN: smudge test-delay10.a $S [OK] -- [DELAYED]
735
- IN: smudge test-delay11.a $S [OK] -- [DELAYED]
736
- IN: smudge test-delay20.a $S [OK] -- [DELAYED]
755
+ IN: smudge test.a $M $ S [OK] -- OUT: $S . [OK]
756
+ IN: smudge test-delay10.a $M $ S [OK] -- [DELAYED]
757
+ IN: smudge test-delay11.a $M $ S [OK] -- [DELAYED]
758
+ IN: smudge test-delay20.a $M $ S [OK] -- [DELAYED]
737
759
IN: list_available_blobs test-delay10.a test-delay11.a [OK]
738
- IN: smudge test-delay10.a 0 [OK] -- OUT: $S . [OK]
739
- IN: smudge test-delay11.a 0 [OK] -- OUT: $S . [OK]
760
+ IN: smudge test-delay10.a $M 0 [OK] -- OUT: $S . [OK]
761
+ IN: smudge test-delay11.a $M 0 [OK] -- OUT: $S . [OK]
740
762
IN: list_available_blobs test-delay20.a [OK]
741
- IN: smudge test-delay20.a 0 [OK] -- OUT: $S . [OK]
763
+ IN: smudge test-delay20.a $M 0 [OK] -- OUT: $S . [OK]
742
764
IN: list_available_blobs [OK]
743
765
STOP
744
766
EOF
745
767
cat >b.exp <<-EOF &&
746
768
START
747
769
init handshake complete
748
- IN: smudge test-delay10.b $S [OK] -- [DELAYED]
770
+ IN: smudge test-delay10.b $M $ S [OK] -- [DELAYED]
749
771
IN: list_available_blobs test-delay10.b [OK]
750
- IN: smudge test-delay10.b 0 [OK] -- OUT: $S . [OK]
772
+ IN: smudge test-delay10.b $M 0 [OK] -- OUT: $S . [OK]
751
773
IN: list_available_blobs [OK]
752
774
STOP
753
775
EOF
0 commit comments