reftable/stack: add accessor for the hash ID

Add an accessor function that allows callers to access the hash ID of a reftable stack. This function will be used in a subsequent commit. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Nov 26, 2024 at 07:42 UTC c9f76fc7d197d9ed2624400d5fc34d6ab53b7a22
2 files changed +8
reftable/reftable-stack.h
+3
@@ -149,4 +149,7 @@ struct reftable_compaction_stats {
149 struct reftable_compaction_stats *
150 reftable_stack_compaction_stats(struct reftable_stack *st);
151
152 +/* Return the hash of the stack. */
153 +enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st);
154 +
155 #endif
reftable/stack.c
+5
@@ -1791,3 +1791,8 @@ done:
1791 reftable_addition_destroy(add);
1792 return err;
1793 }
1794 +
1795 +enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st)
1796 +{
1797 + return reftable_merged_table_hash_id(st->merged);
1798 +}