From 802c0646ac3c04a16adafde5e7cf899f5fc46821 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 2 Oct 2024 12:55:54 +0200 Subject: reftable/merged: handle allocation failures in `merged_table_init_iter()` Handle allocation failures in `merged_table_init_iter()`. While at it, merge `merged_iter_init()` into the function. It only has a single caller and merging them makes it easier to handle allocation failures consistently. This change also requires us to adapt `reftable_stack_init_*_iterator()` to bubble up the new error codes of `merged_table_iter_init()`. Adapt callsites accordingly. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- t/unit-tests/t-reftable-stack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 't/unit-tests/t-reftable-stack.c') diff --git a/t/unit-tests/t-reftable-stack.c b/t/unit-tests/t-reftable-stack.c index 65e513d5ec..6e41a4cf7e 100644 --- a/t/unit-tests/t-reftable-stack.c +++ b/t/unit-tests/t-reftable-stack.c @@ -599,7 +599,9 @@ static void t_reftable_stack_iterator(void) reftable_iterator_destroy(&it); - reftable_stack_init_log_iterator(st, &it); + err = reftable_stack_init_log_iterator(st, &it); + check(!err); + reftable_iterator_seek_log(&it, logs[0].refname); for (i = 0; ; i++) { struct reftable_log_record log = { 0 }; -- cgit v1.2.3