]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reftable/stack: add accessor for the hash ID
authorPatrick Steinhardt <ps@pks.im>
Tue, 26 Nov 2024 06:42:54 +0000 (07:42 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Nov 2024 08:18:36 +0000 (17:18 +0900)
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>
reftable/reftable-stack.h
reftable/stack.c

index 54787f2ef530406a7970db058c3a0cf456897978..ae14270ea74108cd4c314ec38e7d5c9a4e731481 100644 (file)
@@ -149,4 +149,7 @@ struct reftable_compaction_stats {
 struct reftable_compaction_stats *
 reftable_stack_compaction_stats(struct reftable_stack *st);
 
+/* Return the hash of the stack. */
+enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st);
+
 #endif
index 10d45e89d009a10daaefd283ff55cb369cd74b5c..8beb5c0541b70524b69cf3e2167f099808822902 100644 (file)
@@ -1791,3 +1791,8 @@ done:
        reftable_addition_destroy(add);
        return err;
 }
+
+enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st)
+{
+       return reftable_merged_table_hash_id(st->merged);
+}