]> Kevux Git Server - rit/commit
odb: introduce generic object counting
authorPatrick Steinhardt <ps@pks.im>
Thu, 12 Mar 2026 08:43:01 +0000 (09:43 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Mar 2026 15:38:43 +0000 (08:38 -0700)
commit6801ffd37df8420917e1feaf03b5f7c175798bff
tree07c19a65d1974eed84639ed1b5682aae2491f8c3
parentb259f2175b0ccd5574fc6b06b8ec5cbeaa860610
odb: introduce generic object counting

Similar to the preceding commit, introduce counting of objects on the
object database level, replacing the logic that we have in
`repo_approximate_object_count()`.

Note that the function knows to cache the object count. It's unclear
whether this cache is really required as we shouldn't have that many
cases where we count objects repeatedly. But to be on the safe side the
caching mechanism is retained, with the only excepting being that we
also have to use the passed flags as caching key.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/gc.c
commit-graph.c
object-name.c
odb.c
odb.h
packfile.c
packfile.h