Skip to content

Commit

Permalink
midx: use midx in approximate_object_count
Browse files Browse the repository at this point in the history
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
derrickstolee authored and gitster committed Jul 20, 2018
1 parent a40498a commit b8990fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b8990fb

Please sign in to comment.