diff options
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -1020,7 +1020,7 @@ struct pack_window { unsigned int inuse_cnt; }; -extern struct packed_git { +struct packed_git { struct packed_git *next; struct pack_window *windows; off_t pack_size; @@ -1038,7 +1038,7 @@ extern struct packed_git { unsigned char sha1[20]; /* something like ".git/objects/pack/xxxxx.pack" */ char pack_name[FLEX_ARRAY]; /* more */ -} *packed_git; +}; struct pack_entry { off_t offset; @@ -1046,6 +1046,20 @@ struct pack_entry { struct packed_git *p; }; +/* + * packed_git_foreach_fn implementations should return zero + * to continue the traversal, non-zero to halt. + */ +typedef int (*packed_git_foreach_fn)(struct packed_git *, void *); + +/* + * The 'hint' argument is for the commonly-used 'last found pack' optimization. + * It can be NULL. + */ +extern void foreach_packed_git(packed_git_foreach_fn fn, struct packed_git *hint, void *data); + +extern size_t packed_git_count(void); +extern size_t packed_git_local_count(void); extern struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path); /* A hook for count-objects to report invalid files in pack directory */ |