Re: [PATCH v3 06/11] bundle-uri client: add helper for testing server
- From
Victoria Dye <vdye@github.com>
- Date
- Dec 5, 2022, 23:32 UTC
- Message-ID
- <c0a0dd7b-3ffa-eff7-8ddd-19e8efd24575@github.com>
- In-Reply-To
- <46a58e83caf6d37e5a62b39d3c2e35e278211297.1670262639.git.gitgitgadget@gmail.com>
Ævar Arnfjörð Bjarmason via GitGitGadget wrote:
Show 12 quoted lines
> From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= > <avarab@gmail.com> > > 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/b009b4f58ea312e40af385ea5ca7ede5ea07391a.1670262639.git.gitgitgadget@gmail.com/
Show 14 quoted lines
> 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!