summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-13 18:02:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-17 16:14:59 (GMT)
commit0a489b0680b841d3e7714be53b263ff190c39193 (patch)
treef340f2070351a966d7a5e7dfa495514642460a1f /cache.h
parente88b8586bfd967cbfec62359cf4c53ec65848054 (diff)
downloadgit-0a489b0680b841d3e7714be53b263ff190c39193.zip
git-0a489b0680b841d3e7714be53b263ff190c39193.tar.gz
git-0a489b0680b841d3e7714be53b263ff190c39193.tar.bz2
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.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/cache.h b/cache.h
index 4f55466..c6de1e9 100644
--- a/cache.h
+++ b/cache.h
@@ -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);