Re: [PATCH 4/4] upload-pack: only accept packfile-uris if we advertised it
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 29, 2024, 16:34 UTC
- Message-ID
- <xmqqmsrji5zr.fsf@gitster.g>
- In-Reply-To
- <20240229054239.GA1669526@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 18 quoted lines
> 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).Ah, good finding. Will use it to amend.
I wonder if it is still worth testing if the command is happy with an input that lacks object-format capability under SHA-1 mode. This test piece is primarily about packfile-uris, so in that sense, we are not all that interested in that unspecified client object-format defaults to the initial value of serve.c:client_hash_algo (which is SHA-1), and not testing that here is perfectly fine, I guess.
Thanks.