Files
git/packfile-list.h
Patrick Steinhardt 3704b5116a packfile: split out packfile list logic
In the next commit we're about to introduce the "packed" object database
source. This source will embed a packfile list, and consequently we'll
have to include "packfile.h" to make the struct definition available.
This will unfortunately lead to a cyclic dependency that we cannot
resolve with a forward declaration.

Split out the code that relates to the packfile list into a separate
compilation unit so that both "packfile.h" and "odb/source-packed.h" can
include it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-06-10 00:59:38 +09:00

29 lines
831 B
C

#ifndef PACKFILE_LIST_H
#define PACKFILE_LIST_H
struct object_id;
struct packfile_list {
struct packfile_list_entry *head, *tail;
};
struct packfile_list_entry {
struct packfile_list_entry *next;
struct packed_git *pack;
};
void packfile_list_clear(struct packfile_list *list);
void packfile_list_remove(struct packfile_list *list, struct packed_git *pack);
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);
#endif