strbuf_release(&path);
}
-static int approximate_object_count_valid;
-
/*
* Give a fast, rough count of the number of objects in the repository. This
* ignores loose objects completely. If you have a lot of them, then either
*/
unsigned long approximate_object_count(void)
{
- static unsigned long count;
- if (!approximate_object_count_valid) {
+ if (!the_repository->objects->approximate_object_count_valid) {
+ unsigned long count;
struct packed_git *p;
prepare_packed_git();
continue;
count += p->num_objects;
}
+ the_repository->objects->approximate_object_count = count;
}
- return count;
+ return the_repository->objects->approximate_object_count;
}
static void *get_next_packed_git(const void *p)
if (the_repository->objects->packed_git_initialized)
return;
prepare_packed_git_one(get_object_directory(), 1);
- prepare_alt_odb();
+ prepare_alt_odb(the_repository);
for (alt = the_repository->objects->alt_odb_list; alt; alt = alt->next)
prepare_packed_git_one(alt->path, 0);
rearrange_packed_git();
void reprepare_packed_git(void)
{
- approximate_object_count_valid = 0;
+ the_repository->objects->approximate_object_count_valid = 0;
the_repository->objects->packed_git_initialized = 0;
prepare_packed_git();
}