diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-06-25 22:27:47 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-25 22:27:47 +0300 |
commit | 34e849b05a454a2c6487f8fbfa68c39932d22730 (patch) | |
tree | 7a71a357e9f7e2c977849224ca18b2cb9a4461ea /transport.c | |
parent | 10462829e35d1a88ef89be0465a5ee9fd229dc3a (diff) | |
parent | cae2ee105505d45a92cf7abcc26f22890bce4202 (diff) |
Merge branch 'jt/cdn-offload'
The "fetch/clone" protocol has been updated to allow the server to
instruct the clients to grab pre-packaged packfile(s) in addition
to the packed object data coming over the wire.
* jt/cdn-offload:
upload-pack: fix a sparse '0 as NULL pointer' warning
upload-pack: send part of packfile response as uri
fetch-pack: support more than one pack lockfile
upload-pack: refactor reading of pack-objects out
Documentation: add Packfile URIs design doc
Documentation: order protocol v2 sections
http-fetch: support fetching packfiles by URL
http-fetch: refactor into function
http: refactor finish_http_pack_request()
http: use --stdin when indexing dumb HTTP pack
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/transport.c b/transport.c index 7d50c502ad..6ee6771f55 100644 --- a/transport.c +++ b/transport.c @@ -378,7 +378,7 @@ static int fetch_refs_via_pack(struct transport *transport, refs = fetch_pack(&args, data->fd, refs_tmp ? refs_tmp : transport->remote_refs, to_fetch, nr_heads, &data->shallow, - &transport->pack_lockfile, data->version); + &transport->pack_lockfiles, data->version); close(data->fd[0]); close(data->fd[1]); @@ -921,6 +921,7 @@ struct transport *transport_get(struct remote *remote, const char *url) struct transport *ret = xcalloc(1, sizeof(*ret)); ret->progress = isatty(2); + string_list_init(&ret->pack_lockfiles, 1); if (!remote) BUG("No remote provided to transport_get()"); @@ -1316,10 +1317,11 @@ int transport_fetch_refs(struct transport *transport, struct ref *refs) void transport_unlock_pack(struct transport *transport) { - if (transport->pack_lockfile) { - unlink_or_warn(transport->pack_lockfile); - FREE_AND_NULL(transport->pack_lockfile); - } + int i; + + for (i = 0; i < transport->pack_lockfiles.nr; i++) + unlink_or_warn(transport->pack_lockfiles.items[i].string); + string_list_clear(&transport->pack_lockfiles, 0); } int transport_connect(struct transport *transport, const char *name, |