Subject: Re: [PATCH v3 06/11] bundle-uri client: add helper for testing server

From: Victoria Dye <[email-masked]>
Date: Mon, 5 Dec 2022 15:32:35 -0800

Ævar Arnfjörð Bjarmason via GitGitGadget wrote:
> From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?=
>  <[email-masked]>
> 
> Add a 'test-tool bundle-uri ls-remote' command. This is a thin wrapper
> for issuing protocol v2 "bundle-uri" commands to a server, and to the
> parsing routines in bundle-uri.c.
> 
> In the "git clone" case we'll have already done the handshake(),
> but not here. Add an extra case to check for this handshake in
> get_bundle_uri() for ease of use for future callers. Rename the existing
> 'got_remote_heads' to 'finished_handshake' to make it more clear what
> that bit represents.

nit: I think this last sentence ("Rename...") is out-of-place, since you
made that change in patch 5 [1].

[1] https://lore.kernel.org/git/b009[email-masked]/

> diff --git a/transport.c b/transport.c
> index a2281d95262..97d395e10a3 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -371,6 +371,13 @@ static int get_bundle_uri(struct transport *transport)
>  		init_bundle_list(transport->bundles);
>  	}
>  
> +	if (!data->finished_handshake) {
> +		struct ref *refs = handshake(transport, 0, NULL, 0);
> +
> +		if (refs)
> +			free_refs(refs);
> +	}

This makes more sense without the extra assertions. Thanks!