diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-10-09 10:01:39 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-16 14:42:39 -0700 |
| commit | 86d8c62f48a1b193299de19c4dbc664650a853f1 (patch) | |
| tree | 298065976ca8ffaf25137cabedf391d5b0a835d0 /repack-geometry.c | |
| parent | 5b410c82768c025814af17e23cea3b7f253f111d (diff) | |
| download | git-86d8c62f48a1b193299de19c4dbc664650a853f1.tar.xz | |
packfile: introduce macro to iterate through packs
We have a bunch of different sites that want to iterate through all
packs of a given `struct packfile_store`. This pattern is somewhat
verbose and repetitive, which makes it somewhat cumbersome.
Introduce a new macro `repo_for_each_pack()` that removes some of the
boilerplate.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repack-geometry.c')
| -rw-r--r-- | repack-geometry.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/repack-geometry.c b/repack-geometry.c index e2f9794d7d..b3e32cd07e 100644 --- a/repack-geometry.c +++ b/repack-geometry.c @@ -29,11 +29,10 @@ void pack_geometry_init(struct pack_geometry *geometry, struct existing_packs *existing, const struct pack_objects_args *args) { - struct packfile_store *packs = existing->repo->objects->packfiles; struct packed_git *p; struct strbuf buf = STRBUF_INIT; - for (p = packfile_store_get_all_packs(packs); p; p = p->next) { + repo_for_each_pack(existing->repo, p) { if (args->local && !p->pack_local) /* * When asked to only repack local packfiles we skip |
