aboutsummaryrefslogtreecommitdiff
path: root/reftable/reftable-writer.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-14 17:53:48 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-14 17:53:48 -0800
commit82522a9e2ce3e2b400a217a21b05204a2034edbc (patch)
treef893beca295e99602b5cdd57a38263827ca3e0f3 /reftable/reftable-writer.h
parentc3fffcfe8e6c3bfbe358366c973a6109fb95d4e6 (diff)
parent017bd8923986acd4992fd21f3451fdd15ec6edce (diff)
downloadgit-82522a9e2ce3e2b400a217a21b05204a2034edbc.tar.xz
Merge branch 'kn/reflog-migration-fix-followup'
Code clean-up. * kn/reflog-migration-fix-followup: reftable: prevent 'update_index' changes after adding records refs: use 'uint64_t' for 'ref_update.index' refs: mark `ref_transaction_update_reflog()` as static
Diffstat (limited to 'reftable/reftable-writer.h')
-rw-r--r--reftable/reftable-writer.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/reftable/reftable-writer.h b/reftable/reftable-writer.h
index bfef3b1721..1befe3b07c 100644
--- a/reftable/reftable-writer.h
+++ b/reftable/reftable-writer.h
@@ -124,17 +124,21 @@ int reftable_writer_new(struct reftable_writer **out,
int (*flush_func)(void *),
void *writer_arg, const struct reftable_write_options *opts);
-/* Set the range of update indices for the records we will add. When writing a
- table into a stack, the min should be at least
- reftable_stack_next_update_index(), or REFTABLE_API_ERROR is returned.
-
- For transactional updates to a stack, typically min==max, and the
- update_index can be obtained by inspeciting the stack. When converting an
- existing ref database into a single reftable, this would be a range of
- update-index timestamps.
+/*
+ * Set the range of update indices for the records we will add. When writing a
+ * table into a stack, the min should be at least
+ * reftable_stack_next_update_index(), or REFTABLE_API_ERROR is returned.
+ *
+ * For transactional updates to a stack, typically min==max, and the
+ * update_index can be obtained by inspeciting the stack. When converting an
+ * existing ref database into a single reftable, this would be a range of
+ * update-index timestamps.
+ *
+ * The function should be called before adding any records to the writer. If not
+ * it will fail with REFTABLE_API_ERROR.
*/
-void reftable_writer_set_limits(struct reftable_writer *w, uint64_t min,
- uint64_t max);
+int reftable_writer_set_limits(struct reftable_writer *w, uint64_t min,
+ uint64_t max);
/*
Add a reftable_ref_record. The record should have names that come after