summaryrefslogtreecommitdiff
path: root/http-backend.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-09-23 12:17:13 +0200
committerJunio C Hamano <gitster@pobox.com>2025-09-24 11:53:51 -0700
commitd2779beb36ff64eb062103db14006f7ae6da5f37 (patch)
tree45f56f67f53b9c957f62af0855a9b826cc978c73 /http-backend.c
parent751808b2a18acba76b824aed4d8b7442bd7f5fca (diff)
packfile: refactor `get_all_packs()` to work on packfile store
The `get_all_packs()` function prepares the packfile store and then returns its packfiles. Refactor it to accept a packfile store instead of a repository to clarify its scope. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-backend.c')
-rw-r--r--http-backend.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/http-backend.c b/http-backend.c
index d5dfe762bb..9084058f1e 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -603,18 +603,19 @@ static void get_head(struct strbuf *hdr, char *arg UNUSED)
static void get_info_packs(struct strbuf *hdr, char *arg UNUSED)
{
size_t objdirlen = strlen(repo_get_object_directory(the_repository));
+ struct packfile_store *packs = the_repository->objects->packfiles;
struct strbuf buf = STRBUF_INIT;
struct packed_git *p;
size_t cnt = 0;
select_getanyfile(hdr);
- for (p = get_all_packs(the_repository); p; p = p->next) {
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
if (p->pack_local)
cnt++;
}
strbuf_grow(&buf, cnt * 53 + 2);
- for (p = get_all_packs(the_repository); p; p = p->next) {
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
if (p->pack_local)
strbuf_addf(&buf, "P %s\n", p->pack_name + objdirlen + 6);
}