object-store: factor out odb_clear_loose_cache()
Add and use a function for emptying the loose object cache, so callers don't have to know any of its implementation details. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
0000d6543f
commit
d4e19e5163
@ -994,11 +994,8 @@ void reprepare_packed_git(struct repository *r)
|
||||
{
|
||||
struct object_directory *odb;
|
||||
|
||||
for (odb = r->objects->odb; odb; odb = odb->next) {
|
||||
oid_array_clear(&odb->loose_objects_cache);
|
||||
memset(&odb->loose_objects_subdir_seen, 0,
|
||||
sizeof(odb->loose_objects_subdir_seen));
|
||||
}
|
||||
for (odb = r->objects->odb; odb; odb = odb->next)
|
||||
odb_clear_loose_cache(odb);
|
||||
|
||||
r->objects->approximate_object_count_valid = 0;
|
||||
r->objects->packed_git_initialized = 0;
|
||||
|
Reference in New Issue
Block a user