Skip to content

Commit

Permalink
reftable/stack: add accessor for the hash ID
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pks-t authored and gitster committed Nov 26, 2024
1 parent 46b5f67 commit c9f76fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions reftable/reftable-stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions reftable/stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1791,3 +1791,8 @@ int reftable_stack_clean(struct reftable_stack *st)
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);
}

0 comments on commit c9f76fc

Please sign in to comment.