]> Kevux Git Server - rit/commit
packfile: introduce macro to iterate through packs
authorPatrick Steinhardt <ps@pks.im>
Thu, 9 Oct 2025 08:01:39 +0000 (10:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Oct 2025 21:42:39 +0000 (14:42 -0700)
commit86d8c62f48a1b193299de19c4dbc664650a853f1
tree298065976ca8ffaf25137cabedf391d5b0a835d0
parent5b410c82768c025814af17e23cea3b7f253f111d
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>
20 files changed:
builtin/cat-file.c
builtin/count-objects.c
builtin/fsck.c
builtin/gc.c
builtin/pack-objects.c
builtin/pack-redundant.c
connected.c
http-backend.c
http.c
object-name.c
pack-bitmap.c
pack-objects.c
packfile.c
packfile.h
repack-cruft.c
repack-geometry.c
repack.c
server-info.c
t/helper/test-find-pack.c
t/helper/test-pack-mtimes.c