@@ -767,6 +767,21 @@ test_expect_success 'reject cloning shallow repository using HTTP' '
git clone --no-reject-shallow $HTTPD_URL/smart/repo.git repo
'
+test_expect_success 'auto-discover bundle URI from HTTP clone' '
+ test_when_finished rm -rf repo "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" &&
+ git -C src bundle create "$HTTPD_DOCUMENT_ROOT_PATH/everything.bundle" --all &&
+ git clone --bare --no-local src "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" &&
+ git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" config \
+ serve.bundleuri $HTTPD_URL/everything.bundle &&
+ GIT_TRACE2_EVENT="$(pwd)/trace.txt" \
+ git -c protocol.version=2 clone \
+ $HTTPD_URL/smart/repo2.git repo &&
+ cat >pat <<-\EOF &&
+ "event":"child_start".*"argv":\["git","bundle","unbundle"
+ EOF
+ grep -f pat trace.txt
+'
+
# DO NOT add non-httpd-specific tests here, because the last part of this
# test script is only executed when httpd is available and enabled.