summaryrefslogtreecommitdiff
path: root/object-store.h
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-01-06 17:45:30 +0100
committerJunio C Hamano <gitster@pobox.com>2019-01-08 09:40:19 -0800
commit0000d6543f1c2ceea017161a2807167cdfbf8c0b (patch)
tree5b6a69a5dedba99739ecee0c2f9c617ab4cac157 /object-store.h
parentecbdaf0899161c067986e9d9d564586d4b045d62 (diff)
downloadgit-0000d6543f1c2ceea017161a2807167cdfbf8c0b.tar.gz
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 <peff@peff.net> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-store.h')
-rw-r--r--object-store.h7
1 files changed, 7 insertions, 0 deletions
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;