aboutsummaryrefslogtreecommitdiffstats
path: root/http.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-10-30 11:38:40 +0100
committerJunio C Hamano <gitster@pobox.com>2025-10-30 07:09:52 -0700
commit89219bc0cd09ada8a204e0ace0bd15decaea7d31 (patch)
treec56034339260eb35f5859814598fa975a0e2b540 /http.h
parentpackfile: move the MRU list into the packfile store (diff)
downloadgit-89219bc0cd09ada8a204e0ace0bd15decaea7d31.tar.gz
git-89219bc0cd09ada8a204e0ace0bd15decaea7d31.zip
http: refactor subsystem to use `packfile_list`s
The dumb HTTP protocol directly fetches packfiles from the remote server and temporarily stores them in a list of packfiles. Those packfiles are not yet added to the repository's packfile store until we finalize the whole fetch. Refactor the code to instead use a `struct packfile_list` to store those packs. This prepares us for a subsequent change where the `->next` pointer of `struct packed_git` will go away. Note that this refactoring creates some temporary duplication of code, as we now have both `packfile_list_find_oid()` and `find_oid_pack()`. The latter function will be removed in a subsequent commit though. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.h')
-rw-r--r--http.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/http.h b/http.h
index 553e16205c..f9d4593404 100644
--- a/http.h
+++ b/http.h
@@ -2,6 +2,7 @@
#define HTTP_H
struct packed_git;
+struct packfile_list;
#include "git-zlib.h"
@@ -190,7 +191,7 @@ struct curl_slist *http_append_auth_header(const struct credential *c,
/* Helpers for fetching packs */
int http_get_info_packs(const char *base_url,
- struct packed_git **packs_head);
+ struct packfile_list *packs);
/* Helper for getting Accept-Language header */
const char *http_get_accept_language_header(void);
@@ -226,7 +227,7 @@ void release_http_pack_request(struct http_pack_request *preq);
* from http_get_info_packs() and have chosen a specific pack to fetch.
*/
void http_install_packfile(struct packed_git *p,
- struct packed_git **list_to_remove_from);
+ struct packfile_list *list_to_remove_from);
/* Helpers for fetching object */
struct http_object_request {