diff options
author | Derrick Stolee <derrickstolee@github.com> | 2022-12-22 16:14:15 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-12-25 08:24:24 +0100 |
commit | ebc39479558fb4893c72a35065e6792515acef86 (patch) | |
tree | 5db1e885215a171f3ed8dc63d5ee6d89b74a9dbf /transport.c | |
parent | strbuf: introduce strbuf_strip_file_from_path() (diff) | |
download | git-ebc39479558fb4893c72a35065e6792515acef86.tar.xz git-ebc39479558fb4893c72a35065e6792515acef86.zip |
bundle-uri: allow relative URLs in bundle lists
Bundle providers may want to distribute that data across multiple CDNs.
This might require a change in the base URI, all the way to the domain
name. If all bundles require an absolute URI in their 'uri' value, then
every push to a CDN would require altering the table of contents to
match the expected domain and exact location within it.
Allow a bundle list to specify a relative URI for the bundles. This URI
is based on where the client received the bundle list. For a list
provided in the 'bundle-uri' protocol v2 command, the Git remote URI is
the base URI. Otherwise, the bundle list was provided from an HTTP URI
not using the Git protocol, and that URI is the base URI. This allows
easier distribution of bundle data.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | transport.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/transport.c b/transport.c index 0f35114a13..241f8a6ba2 100644 --- a/transport.c +++ b/transport.c @@ -1538,6 +1538,9 @@ int transport_get_remote_bundle_uri(struct transport *transport) if (git_config_get_bool("transfer.bundleuri", &value) || !value) return 0; + if (!transport->bundles->baseURI) + transport->bundles->baseURI = xstrdup(transport->url); + if (!vtable->get_bundle_uri) return error(_("bundle-uri operation not supported by protocol")); |