summaryrefslogtreecommitdiff
path: root/fsck.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-01-05 19:42:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-05 22:58:29 (GMT)
commit1f3299fda9d0800d8e882540d36e4d78797e998e (patch)
tree60990fb9370a94d870c46bf8e4c35d9174d1a5d9 /fsck.h
parentacf9de4c94e0de260f962dc04cc4f9007cedbf1a (diff)
downloadgit-1f3299fda9d0800d8e882540d36e4d78797e998e.zip
git-1f3299fda9d0800d8e882540d36e4d78797e998e.tar.gz
git-1f3299fda9d0800d8e882540d36e4d78797e998e.tar.bz2
fsck: make fsck_config() re-usable
Move the fsck_config() function from builtin/fsck.c to fsck.[ch]. This allows for re-using it in other tools that expose fsck logic and want to support its configuration variables. A logical continuation of this change would be to use a common function for all of {fetch,receive}.fsck.* and fsck.*. See 5d477a334a6 (fsck (receive-pack): allow demoting errors to warnings, 2015-06-22) and my own 1362df0d413 (fetch: implement fetch.fsck.*, 2018-07-27) for the relevant code. However, those routines want to not parse the fsck.skipList into OIDs, but rather pass them along with the --strict option to another process. It would be possible to refactor that whole thing so we support e.g. a "fetch." prefix, then just keep track of the skiplist as a filename instead of parsing it, and learn to spew that all out from our internal structures into something we can append to the --strict option. But instead I'm planning to re-use this in "mktag", which'll just re-use these "fsck.*" variables as-is. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.h')
-rw-r--r--fsck.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fsck.h b/fsck.h
index 29ee4c4..423c467 100644
--- a/fsck.h
+++ b/fsck.h
@@ -103,4 +103,11 @@ void fsck_put_object_name(struct fsck_options *options,
const char *fsck_describe_object(struct fsck_options *options,
const struct object_id *oid);
+/*
+ * git_config() callback for use by fsck-y tools that want to support
+ * fsck.<msg> fsck.skipList etc.
+ */
+int fsck_config_internal(const char *var, const char *value, void *cb,
+ struct fsck_options *options);
+
#endif