]> git.ipfire.org Git - thirdparty/git.git/commit - fsck.c
fsck.c: pass along the fsck_msg_id in the fsck_error callback
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 28 Mar 2021 13:15:46 +0000 (15:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Mar 2021 02:03:10 +0000 (19:03 -0700)
commit394d5d31b0d3096aed4513bdacf48fb73003f1df
tree9860250512b34cc93a11be0da1540ddbe1e0f3f7
parent44e07da8bb346c203246eae4f1a498844ee6d1ba
fsck.c: pass along the fsck_msg_id in the fsck_error callback

Change the fsck_error callback to also pass along the
fsck_msg_id. Before this change the only way to get the message id was
to parse it back out of the "message".

Let's pass it down explicitly for the benefit of callers that might
want to use it, as discussed in [1].

Passing the msg_type is now redundant, as you can always get it back
from the msg_id, but I'm not changing that convention. It's really
common to need the msg_type, and the report() function itself (which
calls "fsck_error") needs to call fsck_msg_type() to discover
it. Let's not needlessly re-do that work in the user callback.

1. https://lore.kernel.org/git/87blcja2ha.fsf@evledraar.gmail.com/

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