]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack-objects: use BUG(...) not die("BUG: ...")
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 7 Dec 2021 11:05:51 +0000 (12:05 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Dec 2021 20:31:16 +0000 (12:31 -0800)
Change this code added in da93d12b004 (pack-objects: be incredibly
anal about stdio semantics, 2006-04-02) to use BUG() instead.

See 1a07e59c3e2 (Update messages in preparation for i18n, 2018-07-21)
for when the "BUG: " prefix was added, and [1] for background on the
Solaris behavior that prompted the exhaustive error checking in this
fgets() loop.

1. https://lore.kernel.org/git/824.1144007555@lotus.CS.Berkeley.EDU/

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

index 1a3dd445f83f4852f695b1caacab80764fb0ac79..0b1f82cd3ad4b7a80f97871ac736407a90de8288 100644 (file)
@@ -3397,7 +3397,7 @@ static void read_object_list_from_stdin(void)
                        if (feof(stdin))
                                break;
                        if (!ferror(stdin))
-                               die("BUG: fgets returned NULL, not EOF, not error!");
+                               BUG("fgets returned NULL, not EOF, not error!");
                        if (errno != EINTR)
                                die_errno("fgets");
                        clearerr(stdin);