]> git.ipfire.org Git - thirdparty/git.git/commit - fsck.c
fsck.c: refactor fsck_msg_type() to limit scope of "int msg_type"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 28 Mar 2021 13:15:39 +0000 (15:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Mar 2021 02:03:10 +0000 (19:03 -0700)
commite35d65a78ab7520b2705b27062758ab20a60e462
tree84c4b4970efcd646f363b7b4962006ff0ca1acab
parent35af754b0694eb26a253edf551efe400f30b3864
fsck.c: refactor fsck_msg_type() to limit scope of "int msg_type"

Refactor "if options->msg_type" and other code added in
0282f4dced0 (fsck: offer a function to demote fsck errors to warnings,
2015-06-22) to reduce the scope of the "int msg_type" variable.

This is in preparation for changing its type in a subsequent commit,
only using it in the "!options->msg_type" scope makes that change

This also brings the code in line with the fsck_set_msg_type()
function (also added in 0282f4dced0), which does a similar check for
"!options->msg_type". Another minor benefit is getting rid of the
style violation of not having braces for the body of the "if".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsck.c