aboutsummaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-20 13:16:09 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-20 13:16:09 -0700
commit7f757675549755627d0c778296f0b13f331795be (patch)
treec3b6fd9ebcbbdba017a4dd8d183354833ab5340c /commit-graph.c
parentca1db8a0f7dc0dbea892e99f5b37c5fe5861be71 (diff)
parent736cef847cf788d90f39d15bb4be684bc4ba1013 (diff)
downloadgit-7f757675549755627d0c778296f0b13f331795be.tar.xz
Merge branch 'ps/object-counting' into ps/odb-generic-object-name-handling
* ps/object-counting: object-file: fix sparse 'plain integer as NULL pointer' error odb: introduce generic object counting odb/source: introduce generic object counting object-file: generalize counting objects object-file: extract logic to approximate object count packfile: extract logic to count number of objects odb: stop including "odb/source.h"
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/commit-graph.c b/commit-graph.c
index f8e24145a5..c030003330 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -2607,7 +2607,8 @@ int write_commit_graph(struct odb_source *source,
replace = ctx.opts->split_flags & COMMIT_GRAPH_SPLIT_REPLACE;
}
- ctx.approx_nr_objects = repo_approximate_object_count(r);
+ if (odb_count_objects(r->objects, ODB_COUNT_OBJECTS_APPROXIMATE, &ctx.approx_nr_objects) < 0)
+ ctx.approx_nr_objects = 0;
if (ctx.append && g) {
for (i = 0; i < g->num_commits; i++) {