]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fsck.h
t1415: set REFFILES for test specific to storage format
[thirdparty/git.git] / fsck.h
diff --git a/fsck.h b/fsck.h
index 66c4a71139a97bc5d6ca1b1bcf814a9b1a173da9..7202c3c87e8b94d3ba7811a21dca5cdbb46f81e5 100644 (file)
--- a/fsck.h
+++ b/fsck.h
@@ -82,6 +82,9 @@ enum fsck_msg_id {
 struct fsck_options;
 struct object;
 
+void fsck_set_msg_type_from_ids(struct fsck_options *options,
+                               enum fsck_msg_id msg_id,
+                               enum fsck_msg_type msg_type);
 void fsck_set_msg_type(struct fsck_options *options,
                       const char *msg_id, const char *msg_type);
 void fsck_set_msg_types(struct fsck_options *options, const char *values);
@@ -101,11 +104,19 @@ typedef int (*fsck_walk_func)(struct object *obj, enum object_type object_type,
 /* callback for fsck_object, type is FSCK_ERROR or FSCK_WARN */
 typedef int (*fsck_error)(struct fsck_options *o,
                          const struct object_id *oid, enum object_type object_type,
-                         enum fsck_msg_type msg_type, const char *message);
+                         enum fsck_msg_type msg_type, enum fsck_msg_id msg_id,
+                         const char *message);
 
 int fsck_error_function(struct fsck_options *o,
                        const struct object_id *oid, enum object_type object_type,
-                       enum fsck_msg_type msg_type, const char *message);
+                       enum fsck_msg_type msg_type, enum fsck_msg_id msg_id,
+                       const char *message);
+int fsck_error_cb_print_missing_gitmodules(struct fsck_options *o,
+                                          const struct object_id *oid,
+                                          enum object_type object_type,
+                                          enum fsck_msg_type msg_type,
+                                          enum fsck_msg_id msg_id,
+                                          const char *message);
 
 struct fsck_options {
        fsck_walk_func walk;
@@ -113,17 +124,29 @@ struct fsck_options {
        unsigned strict:1;
        enum fsck_msg_type *msg_type;
        struct oidset skiplist;
+       struct oidset gitmodules_found;
+       struct oidset gitmodules_done;
        kh_oid_map_t *object_names;
 };
 
 #define FSCK_OPTIONS_DEFAULT { \
        .skiplist = OIDSET_INIT, \
+       .gitmodules_found = OIDSET_INIT, \
+       .gitmodules_done = OIDSET_INIT, \
        .error_func = fsck_error_function \
 }
 #define FSCK_OPTIONS_STRICT { \
        .strict = 1, \
+       .gitmodules_found = OIDSET_INIT, \
+       .gitmodules_done = OIDSET_INIT, \
        .error_func = fsck_error_function, \
 }
+#define FSCK_OPTIONS_MISSING_GITMODULES { \
+       .strict = 1, \
+       .gitmodules_found = OIDSET_INIT, \
+       .gitmodules_done = OIDSET_INIT, \
+       .error_func = fsck_error_cb_print_missing_gitmodules, \
+}
 
 /* descend in all linked child objects
  * the return value is:
@@ -141,8 +164,6 @@ int fsck_walk(struct object *obj, void *data, struct fsck_options *options);
 int fsck_object(struct object *obj, void *data, unsigned long size,
        struct fsck_options *options);
 
-void register_found_gitmodules(const struct object_id *oid);
-
 /*
  * fsck a tag, and pass info about it back to the caller. This is
  * exposed fsck_object() internals for git-mktag(1).