From: Justin Tobler Date: Mon, 27 Jan 2025 19:21:55 GMT Subject: Re: [PATCH 06/19] reftable/record: don't `BUG()` in `reftable_record_cmp()` Message-ID: In-Reply-To: <20250127-pks-reftable-drop-git-compat-util-v1-6-6e280a564877@pks.im> On 25/01/27 02:04PM, Patrick Steinhardt wrote: > The refatble library aborts with a bug in case `reftable_record_cmp()` s/refatble/reftable/ > is invoked with two records of differing types. This would cause the > program to die without the caller being able to handle the error, which > is not something we want in the context of library code. And it ties us > to the Git codebase. > > Refactor the code such that `reftable_record_cmp()` returns an error > code separate from the actual comparison result. This requires us to > also adapt some callers up the callchain in a similar fashion. > > Signed-off-by: Patrick Steinhardt