diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-03-28 15:15:47 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-29 04:03:10 +0200 |
commit | 53692df2b82f9d5ce15779da7d5227f1b027e193 (patch) | |
tree | 98ee5b34e115f23fe359052b371c2b28a3979e3a /fsck.h | |
parent | fsck.c: pass along the fsck_msg_id in the fsck_error callback (diff) | |
download | git-53692df2b82f9d5ce15779da7d5227f1b027e193.tar.xz git-53692df2b82f9d5ce15779da7d5227f1b027e193.zip |
fsck.c: add an fsck_set_msg_type() API that takes enums
Change code I added in acf9de4c94e (mktag: use fsck instead of custom
verify_tag(), 2021-01-05) to make use of a new API function that takes
the fsck_msg_{id,type} types, instead of arbitrary strings that
we'll (hopefully) parse into those types.
At the time that the fsck_set_msg_type() API was introduced in
0282f4dced0 (fsck: offer a function to demote fsck errors to warnings,
2015-06-22) it was only intended to be used to parse user-supplied
data.
For things that are purely internal to the C code it makes sense to
have the compiler check these arguments, and to skip the sanity
checking of the data in fsck_set_msg_type() which is redundant to
checks we get from the compiler.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | fsck.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |