aboutsummaryrefslogtreecommitdiff
path: root/packfile.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-12 09:43:00 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-12 08:38:42 -0700
commitb259f2175b0ccd5574fc6b06b8ec5cbeaa860610 (patch)
tree62a0f6dae02ca80a874f08c5adb694d202b59222 /packfile.c
parent2b24db1110150138ac1e09bc60d9ae5245909625 (diff)
downloadgit-b259f2175b0ccd5574fc6b06b8ec5cbeaa860610.tar.xz
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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c4
1 files changed, 2 insertions, 2 deletions
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;
}