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
@ -2178,6 +2178,13 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)
|
||||
strbuf_release(&buf);
|
||||
}
|
||||
|
||||
void odb_clear_loose_cache(struct object_directory *odb)
|
||||
{
|
||||
oid_array_clear(&odb->loose_objects_cache);
|
||||
memset(&odb->loose_objects_subdir_seen, 0,
|
||||
sizeof(odb->loose_objects_subdir_seen));
|
||||
}
|
||||
|
||||
static int check_stream_sha1(git_zstream *stream,
|
||||
const char *hdr,
|
||||
unsigned long size,
|
||||
|
Reference in New Issue
Block a user