From 70b9c1037325ee82bc0832f4ca2d30c6ebf4808e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 22 Dec 2022 15:14:12 +0000 Subject: bundle-uri client: add helper for testing server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Derrick Stolee Signed-off-by: Junio C Hamano --- transport.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'transport.c') diff --git a/transport.c b/transport.c index 757ad552bf..0f35114a13 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); + } + /* * "Support" protocol v0 and v2 without bundle-uri support by * silently degrading to a NOOP. -- cgit v1.2.3