From: Junio C Hamano Date: Sun, 20 Aug 2017 06:07:18 +0000 (-0700) Subject: Merge branch 'sb/sha1-file-cleanup' into next X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/85898d1e7c48f411b88bb1f9fad95f0218f24c10?hp=--cc Merge branch 'sb/sha1-file-cleanup' into next Code clean-up. * sb/sha1-file-cleanup: sha1_file: make read_info_alternates static --- 85898d1e7c48f411b88bb1f9fad95f0218f24c10 diff --cc cache.h index 379f88d454,11a2bcd38b..6ef99e7486 --- a/cache.h +++ b/cache.h @@@ -1526,25 -1383,10 +1526,24 @@@ extern void remove_scheduled_dirs(void) extern struct alternate_object_database { struct alternate_object_database *next; - char *name; - char base[FLEX_ARRAY]; /* more */ + + /* see alt_scratch_buf() */ + struct strbuf scratch; + size_t base_len; + + /* + * 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! + */ + char loose_objects_subdir_seen[256]; + struct oid_array loose_objects_cache; + + char path[FLEX_ARRAY]; } *alt_odb_list; extern void prepare_alt_odb(void); - extern void read_info_alternates(const char * relative_base, int depth); extern char *compute_alternate_path(const char *path, struct strbuf *err); typedef int alt_odb_fn(struct alternate_object_database *, void *); extern int foreach_alt_odb(alt_odb_fn, void*);