From 0000d6543f1c2ceea017161a2807167cdfbf8c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 6 Jan 2019 17:45:30 +0100 Subject: object-store: factor out odb_loose_cache() Add and use a function for loading the entries of a loose object subdirectory for a given object ID. It frees callers from deriving the fanout key; they can use the returned oid_array reference for lookups or forward range scans. Suggested-by: Jeff King Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- object-store.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'object-store.h') diff --git a/object-store.h b/object-store.h index 60758efad8..7236c571c0 100644 --- a/object-store.h +++ b/object-store.h @@ -54,6 +54,13 @@ void add_to_alternates_memory(const char *dir); */ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr); +/* + * Populate and return the loose object cache array corresponding to the + * given object ID. + */ +struct oid_array *odb_loose_cache(struct object_directory *odb, + const struct object_id *oid); + struct packed_git { struct packed_git *next; struct list_head mru; -- cgit v1.2.1