summaryrefslogtreecommitdiff
path: root/sha1-file.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-01-06 16:45:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-08 17:40:19 (GMT)
commitd4e19e516325e211cedb070a487453ad2d1043be (patch)
treeaab53eee02f9c5219df3d85060fc9cdff9763fe7 /sha1-file.c
parent0000d6543f1c2ceea017161a2807167cdfbf8c0b (diff)
downloadgit-d4e19e516325e211cedb070a487453ad2d1043be.zip
git-d4e19e516325e211cedb070a487453ad2d1043be.tar.gz
git-d4e19e516325e211cedb070a487453ad2d1043be.tar.bz2
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 cb8583b..2f965b2 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,