@@ -717,7 +717,29 @@ test_expect_success 'setup for promisor.quiet tests' '
717717 git -C server rm foo.t &&
718718 git -C server commit -m remove &&
719719 git -C server config uploadpack.allowanysha1inwant 1 &&
720- git -C server config uploadpack.allowfilter 1
720+ git -C server config uploadpack.allowfilter 1 &&
721+
722+ # Setup for submodule repo test: superproject whose submodule is a
723+ # partial clone, so that promisor.quiet is read via a non-main repo.
724+ rm -rf sub-pc-src sub-pc-srv.bare super-src super-work &&
725+ git init sub-pc-src &&
726+ test_commit -C sub-pc-src initial file.txt "hello" &&
727+
728+ git clone --bare sub-pc-src sub-pc-srv.bare &&
729+ git -C sub-pc-srv.bare config uploadpack.allowfilter 1 &&
730+ git -C sub-pc-srv.bare config uploadpack.allowanysha1inwant 1 &&
731+
732+ git init super-src &&
733+ git -C super-src -c protocol.file.allow=always \
734+ submodule add "file://$(pwd)/sub-pc-srv.bare" sub &&
735+ git -C super-src commit -m "add submodule" &&
736+
737+ git -c protocol.file.allow=always clone super-src super-work &&
738+ git -C super-work -c protocol.file.allow=always \
739+ submodule update --init --filter=blob:none sub &&
740+
741+ # Allow file:// in the submodule so that lazy-fetch subprocesses work.
742+ git -C super-work/sub config protocol.file.allow always
721743'
722744
723745test_expect_success TTY ' promisor.quiet=false shows progress messages' '
@@ -752,6 +774,27 @@ test_expect_success TTY 'promisor.quiet=unconfigured shows progress messages' '
752774 grep "Receiving objects" err
753775'
754776
777+ test_expect_success ' promisor.quiet from submodule repo is honored' '
778+ rm -f pc-quiet-trace &&
779+
780+ # Set promisor.quiet only in the submodule, not the superproject.
781+ git -C super-work/sub config promisor.quiet true &&
782+
783+ # Push a new commit+blob to the server; the blob stays missing in the
784+ # partial-clone submodule until a lazy fetch is triggered.
785+ test_commit -C sub-pc-src updated new-file.txt "world" &&
786+ git -C sub-pc-src push "$(pwd)/sub-pc-srv.bare" HEAD:master &&
787+ git -C super-work/sub -c protocol.file.allow=always fetch origin &&
788+ git -C super-work/sub reset --mixed origin/master &&
789+
790+ # grep descends into the submodule and triggers a lazy fetch for the
791+ # missing blob; verify the fetch subprocess carries --quiet.
792+ GIT_TRACE2_EVENT="$(pwd)/pc-quiet-trace" \
793+ git -C super-work grep --cached --recurse-submodules "world" \
794+ 2>/dev/null &&
795+ grep negotiationAlgorithm pc-quiet-trace | grep -e --quiet
796+ '
797+
755798. " $TEST_DIRECTORY " /lib-httpd.sh
756799start_httpd
757800
0 commit comments