From: Junio C Hamano Date: Sun, 10 Sep 2017 08:03:04 +0000 (+0900) Subject: Merge branch 'sb/sha1-file-cleanup' into maint X-Git-Tag: v2.14.2~11 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f04f860dfa80f9bb7f185fa9b6fecc73dbe902b4 Merge branch 'sb/sha1-file-cleanup' into maint Code clean-up. * sb/sha1-file-cleanup: sha1_file: make read_info_alternates static --- f04f860dfa80f9bb7f185fa9b6fecc73dbe902b4 diff --cc cache.h index ee2db602bc,11a2bcd38b..849bc0dcdd --- a/cache.h +++ b/cache.h @@@ -1527,25 -1383,10 +1527,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*);