diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-08-13 21:02:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-17 19:14:59 +0300 |
commit | 0a489b0680b841d3e7714be53b263ff190c39193 (patch) | |
tree | f340f2070351a966d7a5e7dfa495514642460a1f /cache.h | |
parent | e88b8586bfd967cbfec62359cf4c53ec65848054 (diff) |
prepare_packed_git(): refactor garbage reporting in pack directory
The hook to report "garbage" files in $GIT_OBJECT_DIRECTORY/pack/
could be generic but is too specific to count-object's needs.
Move the part to produce human-readable messages to count-objects,
and refine the interface to callback with the "bits" with values
defined in the cache.h header file, so that other callers (e.g.
prune) can later use the same mechanism to enumerate different
kinds of garbage files and do something intelligent about them,
other than reporting in textual messages.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1255,8 +1255,11 @@ struct pack_entry { 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 */ -extern void (*report_garbage)(const char *desc, const char *path); +/* A hook to report invalid files in pack directory */ +#define PACKDIR_FILE_PACK 1 +#define PACKDIR_FILE_IDX 2 +#define PACKDIR_FILE_GARBAGE 4 +extern void (*report_garbage)(unsigned seen_bits, const char *path); extern void prepare_packed_git(void); extern void reprepare_packed_git(void); |