]> git.ipfire.org Git - thirdparty/git.git/commit
cache-tree.c: use bug() and BUG_if_bug()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 2 Jun 2022 12:25:37 +0000 (14:25 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Jun 2022 19:55:16 +0000 (12:55 -0700)
commit6d40f0ad15e72daab6524988c9c4b4a3460488f8
tree217edc90a41e23390080b0ea4e09d6a6bd99dda7
parent07b1d8f184e126eef8223757844587cf91d6e14c
cache-tree.c: use bug() and BUG_if_bug()

Change "BUG" output originally added in a97e4075a16 (Keep
rename/rename conflicts of intermediate merges while doing recursive
merge, 2007-03-31), and later made to say it was a "BUG" in
19c6a4f8369 (merge-recursive: do not return NULL only to cause
segfault, 2010-01-21) to use the new bug() function.

This gets the same job done with slightly less code, as we won't need
to prefix lines with "BUG: ". More importantly we'll now log the full
set of messages via trace2, before this we'd only log the one BUG()
invocation.

We don't replace the last "BUG()" invocation with "BUG_if_bug()", as
in this case we're sure that we called bug() earlier, so there's no
need to make it a conditional.

While we're at it let's replace "There" with "there" in the message,
i.e. not start a message with a capital letter, per the
CodingGuidelines.

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