]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/record: stop using `BUG()` in `reftable_record_init()`
authorPatrick Steinhardt <ps@pks.im>
Tue, 18 Feb 2025 09:20:41 +0000 (10:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Feb 2025 18:55:36 +0000 (10:55 -0800)
commit9d9fac0f34ec47cc6eafeb3e10378ab8f3310346
tree2dcef8922bd24884fcda6856291dc32ecbdfd081
parenta967966432f25324c79524c0cb18d6e152d0b6af
reftable/record: stop using `BUG()` in `reftable_record_init()`

We're aborting the program via `BUG()` in case `reftable_record_init()`
was invoked with an unknown record type. This is bad because we may now
die in library code, and because it makes us depend on the Git codebase.

Refactor the code such that `reftable_record_init()` can return an error
code to the caller. Adapt any callers accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/block.c
reftable/merged.c
reftable/reader.c
reftable/record.c
reftable/record.h
t/unit-tests/t-reftable-pq.c
t/unit-tests/t-reftable-record.c