diff options
Diffstat (limited to 'object-store.h')
-rw-r--r-- | object-store.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/object-store.h b/object-store.h index 30faf7b391..bf1e0cb761 100644 --- a/object-store.h +++ b/object-store.h @@ -11,11 +11,12 @@ struct object_directory { struct object_directory *next; /* - * Used to store the results of readdir(3) calls when searching - * for unique abbreviated hashes. This cache is never - * invalidated, thus it's racy and not necessarily accurate. - * That's fine for its purpose; don't use it for tasks requiring - * greater accuracy! + * Used to store the results of readdir(3) calls when we are OK + * sacrificing accuracy due to races for speed. That includes + * our search for unique abbreviated hashes. Don't use it for tasks + * requiring greater accuracy! + * + * Be sure to call odb_load_loose_cache() before using. */ char loose_objects_subdir_seen[256]; struct oid_array loose_objects_cache; @@ -45,6 +46,13 @@ void add_to_alternates_file(const char *dir); */ void add_to_alternates_memory(const char *dir); +/* + * Populate an odb's loose object cache for one particular subdirectory (i.e., + * the one that corresponds to the first byte of objects you're interested in, + * from 0 to 255 inclusive). + */ +void odb_load_loose_cache(struct object_directory *odb, int subdir_nr); + struct packed_git { struct packed_git *next; struct list_head mru; |