aboutsummaryrefslogtreecommitdiff
path: root/packfile.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-12 09:42:57 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-12 08:38:42 -0700
commitdd587cd59e1575f2d5698cb45b42644e1df9b835 (patch)
treef3e5bd152abb585fb8798f0b4e5b4025c4bbb9dc /packfile.h
parent6daeb66baac581ab81148bcb9d5fcc61ae33347e (diff)
downloadgit-dd587cd59e1575f2d5698cb45b42644e1df9b835.tar.xz
packfile: extract logic to count number of objects
In a subsequent commit we're about to introduce a new `odb_source_count_objects()` function so that we can make the logic pluggable. Prepare for this change by extracting the logic that we have to count packed objects into a standalone function. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.h')
-rw-r--r--packfile.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/packfile.h b/packfile.h
index 8b04a258a7..1da8c729cb 100644
--- a/packfile.h
+++ b/packfile.h
@@ -269,6 +269,15 @@ enum kept_pack_type {
};
/*
+ * Count the number objects contained in the given packfile store. If
+ * successful, the number of objects will be written to the `out` pointer.
+ *
+ * Return 0 on success, a negative error code otherwise.
+ */
+int packfile_store_count_objects(struct packfile_store *store,
+ unsigned long *out);
+
+/*
* Retrieve the cache of kept packs from the given packfile store. Accepts a
* combination of `kept_pack_type` flags. The cache is computed on demand and
* will be recomputed whenever the flags change.