aboutsummaryrefslogtreecommitdiff
path: root/fsck.h
diff options
context:
space:
mode:
Diffstat (limited to 'fsck.h')
-rw-r--r--fsck.h42
1 files changed, 14 insertions, 28 deletions
diff --git a/fsck.h b/fsck.h
index 65ecbb7fe1..e77935c8a9 100644
--- a/fsck.h
+++ b/fsck.h
@@ -166,7 +166,10 @@ struct fsck_ref_report {
const char *path;
};
+struct repository;
+
struct fsck_options {
+ struct repository *repo;
fsck_walk_func walk;
fsck_error error_func;
unsigned strict;
@@ -180,34 +183,6 @@ struct fsck_options {
kh_oid_map_t *object_names;
};
-#define FSCK_OPTIONS_DEFAULT { \
- .skip_oids = OIDSET_INIT, \
- .gitmodules_found = OIDSET_INIT, \
- .gitmodules_done = OIDSET_INIT, \
- .gitattributes_found = OIDSET_INIT, \
- .gitattributes_done = OIDSET_INIT, \
- .error_func = fsck_objects_error_function \
-}
-#define FSCK_OPTIONS_STRICT { \
- .strict = 1, \
- .gitmodules_found = OIDSET_INIT, \
- .gitmodules_done = OIDSET_INIT, \
- .gitattributes_found = OIDSET_INIT, \
- .gitattributes_done = OIDSET_INIT, \
- .error_func = fsck_objects_error_function, \
-}
-#define FSCK_OPTIONS_MISSING_GITMODULES { \
- .strict = 1, \
- .gitmodules_found = OIDSET_INIT, \
- .gitmodules_done = OIDSET_INIT, \
- .gitattributes_found = OIDSET_INIT, \
- .gitattributes_done = OIDSET_INIT, \
- .error_func = fsck_objects_error_cb_print_missing_gitmodules, \
-}
-#define FSCK_REFS_OPTIONS_DEFAULT { \
- .error_func = fsck_refs_error_function, \
-}
-
/* descend in all linked child objects
* the return value is:
* -1 error in processing the object
@@ -255,6 +230,17 @@ int fsck_finish(struct fsck_options *options);
*/
bool fsck_has_queued_checks(struct fsck_options *options);
+enum fsck_options_type {
+ FSCK_OPTIONS_DEFAULT,
+ FSCK_OPTIONS_STRICT,
+ FSCK_OPTIONS_MISSING_GITMODULES,
+ FSCK_OPTIONS_REFS,
+};
+
+void fsck_options_init(struct fsck_options *options,
+ struct repository *repo,
+ enum fsck_options_type type);
+
/*
* Clear the fsck_options struct, freeing any allocated memory.
*/