aboutsummaryrefslogtreecommitdiffstats
path: root/packfile.c
diff options
context:
space:
mode:
authorDerrick Stolee <stolee@gmail.com>2018-07-12 15:39:37 -0400
committerJunio C Hamano <gitster@pobox.com>2018-07-20 11:27:29 -0700
commitb8990fbfedf7cd9fc92a5208b0fbbd7dad79be6d (patch)
treee7ed3fcb39ab47efb81097be8cfe3822e391aaa6 /packfile.c
parentmidx: use existing midx when writing new one (diff)
downloadgit-b8990fbfedf7cd9fc92a5208b0fbbd7dad79be6d.tar.xz
git-b8990fbfedf7cd9fc92a5208b0fbbd7dad79be6d.zip
midx: use midx in approximate_object_count
Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/packfile.c b/packfile.c
index c0eb5ac885f..97e7812b6be 100644
--- a/packfile.c
+++ b/packfile.c
@@ -861,10 +861,13 @@ unsigned long approximate_object_count(void)
{
if (!the_repository->objects->approximate_object_count_valid) {
unsigned long count;
+ struct multi_pack_index *m;
struct packed_git *p;
prepare_packed_git(the_repository);
count = 0;
+ for (m = get_multi_pack_index(the_repository); m; m = m->next)
+ count += m->num_objects;
for (p = the_repository->objects->packed_git; p; p = p->next) {
if (open_pack_index(p))
continue;