diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-10-02 12:56:25 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-10-02 07:53:55 -0700 |
commit | 51afc709dc2f502442220954fb3e32f53eeb1e4e (patch) | |
tree | 4a91fe0c5f9ef68463ba8c3330c6068e63065498 /commit-graph.c | |
parent | d0501c8c9d0b67587e112bbe2a85746c7c11a9e8 (diff) |
reftable/tree: handle allocation failures
The tree interfaces of the reftable library handle both insertion and
searching of tree nodes with a single function, where the behaviour is
altered between the two via an `insert` bit. This makes it quit awkward
to handle allocation failures because on inserting we'd have to check
for `NULL` pointers and return an error, whereas on searching entries we
don't have to handle it as an allocation error.
Split up concerns of this function into two separate functions, one for
inserting entries and one for searching entries. This makes it easy for
us to check for allocation errors as `tree_insert()` should never return
a `NULL` pointer now. Adapt callers accordingly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions