611
test_i18ngrep "filtering not recognized by server" err
612
'
613
614
+test_expect_success 'batch missing blob request during checkout' '
615
+ rm -rf server client &&
616
+
617
+ test_create_repo server &&
618
+ echo a >server/a &&
619
+ echo b >server/b &&
620
+ git -C server add a b &&
621
+
622
+ git -C server commit -m x &&
623
+ echo aa >server/a &&
624
+ echo bb >server/b &&
625
+ git -C server add a b &&
626
+ git -C server commit -m x &&
627
+
628
+ test_config -C server uploadpack.allowfilter 1 &&
629
+ test_config -C server uploadpack.allowanysha1inwant 1 &&
630
+
631
+ git clone --filter=blob:limit=0 "file://$(pwd)/server" client &&
632
+
633
+ # Ensure that there is only one negotiation by checking that there is
634
+ # only "done" line sent. ("done" marks the end of negotiation.)
635
+ GIT_TRACE_PACKET="$(pwd)/trace" git -C client checkout HEAD^ &&
636
+ grep "git> done" trace >done_lines &&
637
+ test_line_count = 1 done_lines
638
+'
639
+
640
+test_expect_success 'batch missing blob request does not inadvertently try to fetch gitlinks' '
641
+ rm -rf server client &&
642
+
643
+ test_create_repo repo_for_submodule &&
644
+ test_commit -C repo_for_submodule x &&
645
+
646
+ test_create_repo server &&
647
+ echo a >server/a &&
648
+ echo b >server/b &&
649
+ git -C server add a b &&
650
+ git -C server commit -m x &&
651
+
652
+ echo aa >server/a &&
653
+ echo bb >server/b &&
654
+ # Also add a gitlink pointing to an arbitrary repository
655
+ git -C server submodule add "$(pwd)/repo_for_submodule" c &&
656
+ git -C server add a b c &&
657
+ git -C server commit -m x &&
658
+
659
+ test_config -C server uploadpack.allowfilter 1 &&
660
+ test_config -C server uploadpack.allowanysha1inwant 1 &&
661
+
662
+ # Make sure that it succeeds
663
+ git clone --filter=blob:limit=0 "file://$(pwd)/server" client
664
+'
665
+
666
. "$TEST_DIRECTORY"/lib-httpd.sh
667
start_httpd
668