Signed-off-by: Teng Long <dyroneteng@xxxxxxxxx> --- t/t5702-protocol-v2.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh index 66af411057..cf3bc89775 100755 --- a/t/t5702-protocol-v2.sh +++ b/t/t5702-protocol-v2.sh @@ -945,6 +945,29 @@ test_expect_success 'packfile URIs with fetch instead of clone' ' fetch "$HTTPD_URL/smart/http_parent" ' +test_expect_success 'packfile URIs with fetch by default `fetch.uriprotocols` config' ' + P="$HTTPD_DOCUMENT_ROOT_PATH/http_parent" && + rm -rf "$P" http_child log && + + git init "$P" && + git -C "$P" config "uploadpack.allowsidebandall" "true" && + + echo my-blob >"$P/my-blob" && + git -C "$P" add my-blob && + git -C "$P" commit -m x && + + configure_exclusion "$P" my-blob >h && + + git init http_child && + + GIT_TEST_SIDEBAND_ALL=1 GIT_TRACE_PACKET=`pwd`/log \ + git -C http_child \ + -c protocol.version=2 \ + -c fetch.uriprotocols \ + fetch "$HTTPD_URL/smart/http_parent" && + grep "git< packfile-uris http,https" log +' + test_expect_success 'fetching with valid packfile URI but invalid hash fails' ' P="$HTTPD_DOCUMENT_ROOT_PATH/http_parent" && rm -rf "$P" http_child log && -- 2.32.0.1.g0de8fe24d1.dirty