diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-03-25 12:58:04 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-25 12:58:05 -0700 |
| commit | 8e2964dc89986077af7f8d34b05807d5cbb1cca0 (patch) | |
| tree | e57f1dda22cf10aac2ac5ccb57a2f19c54f865fc /commit-graph.c | |
| parent | 105a22cf692a08604bc294ec2c164528889837b0 (diff) | |
| parent | 6801ffd37df8420917e1feaf03b5f7c175798bff (diff) | |
| download | git-8e2964dc89986077af7f8d34b05807d5cbb1cca0.tar.xz | |
Merge branch 'ps/object-counting'
The logic to count objects has been cleaned up.
* ps/object-counting:
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.c | 3 |
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++) { |
