aboutsummaryrefslogtreecommitdiff
path: root/packfile.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 /packfile.h
parentf905a855b1d1e172ba1e51e03fc5ec531445575e (diff)
downloadgit-89219bc0cd09ada8a204e0ace0bd15decaea7d31.tar.xz
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 'packfile.h')
-rw-r--r--packfile.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/packfile.h b/packfile.h
index 39ed1073e4..a53336d722 100644
--- a/packfile.h
+++ b/packfile.h
@@ -66,6 +66,14 @@ void packfile_list_prepend(struct packfile_list *list, struct packed_git *pack);
void packfile_list_append(struct packfile_list *list, struct packed_git *pack);
/*
+ * Find the pack within the "packs" list whose index contains the object
+ * "oid". For general object lookups, you probably don't want this; use
+ * find_pack_entry() instead.
+ */
+struct packed_git *packfile_list_find_oid(struct packfile_list_entry *packs,
+ const struct object_id *oid);
+
+/*
* A store that manages packfiles for a given object database.
*/
struct packfile_store {