Re: [PATCH 4/4] upload-pack: only accept packfile-uris if we advertised it
On Wed, Feb 28, 2024 at 05:50:50PM -0500, Jeff King wrote:
Show 25 quoted lines
> diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
> index 6ef4971845..902e42c1c0 100755
> --- a/t/t5702-protocol-v2.sh
> +++ b/t/t5702-protocol-v2.sh
> @@ -778,6 +778,24 @@ test_expect_success 'archive with custom path does not request v2' '
> ! grep ^GIT_PROTOCOL env.trace
> '
>
> +test_expect_success 'reject client packfile-uris if not advertised' '
> + {
> + packetize command=fetch &&
> + printf 0001 &&
> + packetize packfile-uris https &&
> + packetize done &&
> + printf 0000
> + } >input &&
> + test_must_fail env GIT_PROTOCOL=version=2 \
> + git upload-pack client <input &&
> + test_must_fail env GIT_PROTOCOL=version=2 \
> + git -c uploadpack.blobpackfileuri \
> + upload-pack client <input &&
> + GIT_PROTOCOL=version=2 \
> + git -c uploadpack.blobpackfileuri=anything \
> + upload-pack client <input
> +'Sorry, this needs one tweak to pass under the sha256 CI job:
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 902e42c1c0..1ef540f73d 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -781,6 +781,7 @@ test_expect_success 'archive with custom path does not request v2' '
test_expect_success 'reject client packfile-uris if not advertised' '
{
packetize command=fetch &&
+ packetize object-format=$(test_oid algo) &&
printf 0001 &&
packetize packfile-uris https &&
packetize done &&
Otherwise the server complains that the other side did not respect its
advertised object-format (I sure am glad to have included the final
"hey, this input works, right?" test there, as that is what caught it).
-Peff