summaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2015-06-22 17:26:48 +0200
committerJunio C Hamano <gitster@pobox.com>2015-06-23 14:27:36 -0700
commitefaba7cc77fb22753675dc1e4f376b61797eca36 (patch)
treeeecd0ed19beea646b5826fbecede70844046cd37 /fsck.c
parentf50c44073051820cd368be4ca520ae43f34fdf8b (diff)
downloadgit-efaba7cc77fb22753675dc1e4f376b61797eca36.tar.gz
fsck: optionally ignore specific fsck issues completely
An fsck issue in a legacy repository might be so common that one would like not to bother the user with mentioning it at all. With this change, that is possible by setting the respective message type to "ignore". This change "abuses" the missingEmail=warn test to verify that "ignore" is also accepted and works correctly. And while at it, it makes sure that multiple options work, too (they are passed to unpack-objects or index-pack as a comma-separated list via the --strict=... command-line option). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fsck.c b/fsck.c
index a4205aaa5f..680f35eff0 100644
--- a/fsck.c
+++ b/fsck.c
@@ -131,6 +131,8 @@ static int parse_msg_type(const char *str)
return FSCK_ERROR;
else if (!strcmp(str, "warn"))
return FSCK_WARN;
+ else if (!strcmp(str, "ignore"))
+ return FSCK_IGNORE;
else
die("Unknown fsck message type: '%s'", str);
}
@@ -222,6 +224,9 @@ static int report(struct fsck_options *options, struct object *object,
struct strbuf sb = STRBUF_INIT;
int msg_type = fsck_msg_type(id, options), result;
+ if (msg_type == FSCK_IGNORE)
+ return 0;
+
if (msg_type == FSCK_FATAL)
msg_type = FSCK_ERROR;