diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-03-12 09:42:59 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-12 08:38:42 -0700 |
| commit | 2b24db1110150138ac1e09bc60d9ae5245909625 (patch) | |
| tree | 1661f7964868da60d42883b5ebb0376e8ea17bde /odb.h | |
| parent | 222fddeaa44b633eea345996735b4f7893eb71ec (diff) | |
| download | git-2b24db1110150138ac1e09bc60d9ae5245909625.tar.xz | |
object-file: generalize counting objects
Generalize the function introduced in the preceding commit to not only
be able to approximate the number of loose objects, but to also provide
an accurate count. The behaviour can be toggled via a new flag.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'odb.h')
| -rw-r--r-- | odb.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -500,6 +500,15 @@ int odb_for_each_object(struct object_database *odb, void *cb_data, unsigned flags); +enum odb_count_objects_flags { + /* + * Instead of providing an accurate count, allow the number of objects + * to be approximated. Details of how this approximation works are + * subject to the specific source's implementation. + */ + ODB_COUNT_OBJECTS_APPROXIMATE = (1 << 0), +}; + enum { /* * By default, `odb_write_object()` does not actually write anything |
