midx: use midx in approximate_object_count
Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
a40498a126
commit
b8990fbfed
@ -861,10 +861,13 @@ unsigned long approximate_object_count(void)
|
|||||||
{
|
{
|
||||||
if (!the_repository->objects->approximate_object_count_valid) {
|
if (!the_repository->objects->approximate_object_count_valid) {
|
||||||
unsigned long count;
|
unsigned long count;
|
||||||
|
struct multi_pack_index *m;
|
||||||
struct packed_git *p;
|
struct packed_git *p;
|
||||||
|
|
||||||
prepare_packed_git(the_repository);
|
prepare_packed_git(the_repository);
|
||||||
count = 0;
|
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) {
|
for (p = the_repository->objects->packed_git; p; p = p->next) {
|
||||||
if (open_pack_index(p))
|
if (open_pack_index(p))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user