Skip to content

Commit c9f76fc

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 46b5f67 commit c9f76fc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

reftable/reftable-stack.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,7 @@ struct reftable_compaction_stats {
149149
struct reftable_compaction_stats *
150150
reftable_stack_compaction_stats(struct reftable_stack *st);
151151

152+
/* Return the hash of the stack. */
153+
enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st);
154+
152155
#endif

reftable/stack.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,3 +1791,8 @@ int reftable_stack_clean(struct reftable_stack *st)
17911791
reftable_addition_destroy(add);
17921792
return err;
17931793
}
1794+
1795+
enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st)
1796+
{
1797+
return reftable_merged_table_hash_id(st->merged);
1798+
}

0 commit comments

Comments
 (0)