aboutsummaryrefslogtreecommitdiff
path: root/reftable/reftable-stack.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-08-12 11:54:19 +0200
committerJunio C Hamano <gitster@pobox.com>2025-08-12 07:40:59 -0700
commit178c5885007b83dd10cac1e09b72ef8d9fe2ac29 (patch)
tree9d00bd40837cd9c1d026140d419f673ac8c9c2e3 /reftable/reftable-stack.h
parent6fb1d819b7c7796e7cfaae44f056d73436469efc (diff)
downloadgit-178c5885007b83dd10cac1e09b72ef8d9fe2ac29.tar.xz
reftable/stack: allow passing flags to `reftable_stack_add()`
The `reftable_stack_add()` function is a simple wrapper to lock the stack, add records to it via a callback and then commit the result. One problem with it though is that it doesn't accept any flags for creating the addition. This makes it impossible to automatically reload the stack in case it was modified before we managed to lock the stack. Add a `flags` field to plug this gap and pass it through accordingly. For now this new flag won't be used by us, but it will be used by libgit2. 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.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/reftable/reftable-stack.h b/reftable/reftable-stack.h
index 910ec6ef3a..d70fcb705d 100644
--- a/reftable/reftable-stack.h
+++ b/reftable/reftable-stack.h
@@ -68,12 +68,15 @@ int reftable_addition_commit(struct reftable_addition *add);
* transaction. Releases the lock if held. */
void reftable_addition_destroy(struct reftable_addition *add);
-/* add a new table to the stack. The write_table function must call
- * reftable_writer_set_limits, add refs and return an error value. */
+/*
+ * Add a new table to the stack. The write_table function must call
+ * reftable_writer_set_limits, add refs and return an error value.
+ * The flags are passed through to `reftable_stack_new_addition()`.
+ */
int reftable_stack_add(struct reftable_stack *st,
int (*write_table)(struct reftable_writer *wr,
void *write_arg),
- void *write_arg);
+ void *write_arg, unsigned flags);
struct reftable_iterator;