From b259f2175b0ccd5574fc6b06b8ec5cbeaa860610 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 12 Mar 2026 09:43:00 +0100 Subject: odb/source: introduce generic object counting Introduce generic object counting on the object database source level with a new backend-specific callback function. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- packfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packfile.c') diff --git a/packfile.c b/packfile.c index 1ee5dd3da3..8ee462303a 100644 --- a/packfile.c +++ b/packfile.c @@ -1102,6 +1102,7 @@ struct packfile_list_entry *packfile_store_get_packs(struct packfile_store *stor } int packfile_store_count_objects(struct packfile_store *store, + enum odb_count_objects_flags flags UNUSED, unsigned long *out) { struct packfile_list_entry *e; @@ -1146,10 +1147,9 @@ unsigned long repo_approximate_object_count(struct repository *r) odb_prepare_alternates(r->objects); for (source = r->objects->sources; source; source = source->next) { - struct odb_source_files *files = odb_source_files_downcast(source); unsigned long c; - if (!packfile_store_count_objects(files->packed, &c)) + if (!odb_source_count_objects(source, ODB_COUNT_OBJECTS_APPROXIMATE, &c)) count += c; } -- cgit v1.3