diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-10-02 12:55:54 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-10-02 07:53:53 -0700 |
| commit | 802c0646ac3c04a16adafde5e7cf899f5fc46821 (patch) | |
| tree | fc6191e41a0978d6b8cc9ff0d14a38fabe46f9dd /reftable/reftable-stack.h | |
| parent | 74d1c18757d1a45b95e46836adf478193a34c42c (diff) | |
| download | git-802c0646ac3c04a16adafde5e7cf899f5fc46821.tar.xz | |
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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/reftable-stack.h')
| -rw-r--r-- | reftable/reftable-stack.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/reftable/reftable-stack.h b/reftable/reftable-stack.h index f4f8cabc7f..e958f911b4 100644 --- a/reftable/reftable-stack.h +++ b/reftable/reftable-stack.h @@ -73,16 +73,16 @@ struct reftable_iterator; * be used to iterate through refs. The iterator is valid until the next reload * or write. */ -void reftable_stack_init_ref_iterator(struct reftable_stack *st, - struct reftable_iterator *it); +int reftable_stack_init_ref_iterator(struct reftable_stack *st, + struct reftable_iterator *it); /* * Initialize an iterator for the merged tables contained in the stack that can * be used to iterate through logs. The iterator is valid until the next reload * or write. */ -void reftable_stack_init_log_iterator(struct reftable_stack *st, - struct reftable_iterator *it); +int reftable_stack_init_log_iterator(struct reftable_stack *st, + struct reftable_iterator *it); /* returns the merged_table for seeking. This table is valid until the * next write or reload, and should not be closed or deleted. |
