]> git.ipfire.org Git - thirdparty/git.git/commit
fsck.c: add an fsck_set_msg_type() API that takes enums
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 28 Mar 2021 13:15:47 +0000 (15:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Mar 2021 02:03:10 +0000 (19:03 -0700)
commit53692df2b82f9d5ce15779da7d5227f1b027e193
tree98ee5b34e115f23fe359052b371c2b28a3979e3a
parent394d5d31b0d3096aed4513bdacf48fb73003f1df
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>
builtin/mktag.c
fsck.c
fsck.h