]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/fsck: refactor to use `odb_for_each_object()`
authorPatrick Steinhardt <ps@pks.im>
Mon, 26 Jan 2026 09:51:24 +0000 (10:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Jan 2026 16:26:07 +0000 (08:26 -0800)
commitcc47e3d38c5be2969df3dba6814ee0e685a07de2
tree03413bdb8ee7ae8fec4173f2be91e7ff146c7648
parentdf2fbdfa553526062e5234286f60bd643941298a
builtin/fsck: refactor to use `odb_for_each_object()`

In git-fsck(1) we have two callsites where we iterate over all objects
via `for_each_loose_object()` and `for_each_packed_object()`. Both of
these are trivially convertible with `odb_for_each_object()`.

Refactor these callsites accordingly.

Note that `odb_for_each_object()` may iterate over the same object
multiple times, for example when it exists both in packed and loose
format. But this has already been the case beforehand, so this does not
result in a change in behaviour.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c