Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-12-22 18:14:10 +0300
committerJunio C Hamano <gitster@pobox.com>2022-12-25 10:24:23 +0300
commit7cce9074a728fb32501054577963d8ae31d007be (patch)
tree8400b171dac2d810bc62463b029fd29bf734b2e4 /transport.c
parent0cfde740f0b2c9474aae3a381d1d6e97c7468e7a (diff)
bundle-uri client: add boolean transfer.bundleURI setting
The yet-to-be introduced client support for bundle-uri will always fall back on a full clone, but we'd still like to be able to ignore a server's bundle-uri advertisement entirely. The new transfer.bundleURI config option defaults to 'false', but a user can set it to 'true' to enable checking for bundle URIs from the origin Git server using protocol v2. Co-authored-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/transport.c b/transport.c
index b6f279e92c..b4cf2c0252 100644
--- a/transport.c
+++ b/transport.c
@@ -1516,6 +1516,7 @@ int transport_fetch_refs(struct transport *transport, struct ref *refs)
int transport_get_remote_bundle_uri(struct transport *transport)
{
+ int value = 0;
const struct transport_vtable *vtable = transport->vtable;
/* Check config only once. */
@@ -1523,6 +1524,13 @@ int transport_get_remote_bundle_uri(struct transport *transport)
return 0;
transport->got_remote_bundle_uri = 1;
+ /*
+ * Don't request bundle-uri from the server unless configured to
+ * do so by the transfer.bundleURI=true config option.
+ */
+ if (git_config_get_bool("transfer.bundleuri", &value) || !value)
+ return 0;
+
if (!vtable->get_bundle_uri)
return error(_("bundle-uri operation not supported by protocol"));