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:
René Scharfe
2019-01-06 17:45:39 +01:00
committed by Junio C Hamano
parent 0000d6543f
commit d4e19e5163
4 changed files with 13 additions and 6 deletions

View File

@ -485,7 +485,7 @@ struct raw_object_store *raw_object_store_new(void)
static void free_object_directory(struct object_directory *odb)
{
free(odb->path);
oid_array_clear(&odb->loose_objects_cache);
odb_clear_loose_cache(odb);
free(odb);
}