summaryrefslogtreecommitdiff
path: root/sha1-file.c
diff options
context:
space:
mode:
authorLibravatar René Scharfe <l.s.r@web.de>2019-01-06 17:45:39 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-01-08 09:40:19 -0800
commitd4e19e516325e211cedb070a487453ad2d1043be (patch)
treeaab53eee02f9c5219df3d85060fc9cdff9763fe7 /sha1-file.c
parentobject-store: factor out odb_loose_cache() (diff)
downloadtgif-d4e19e516325e211cedb070a487453ad2d1043be.tar.xz
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>
Diffstat (limited to 'sha1-file.c')
-rw-r--r--sha1-file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sha1-file.c b/sha1-file.c
index cb8583b634..2f965b2688 100644
--- a/sha1-file.c
+++ b/sha1-file.c
@@ -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,