aboutsummaryrefslogtreecommitdiffstats
path: root/reftable/stack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-10 10:04:57 +0900
committerJunio C Hamano <gitster@pobox.com>2024-12-10 10:04:58 +0900
commit7041902dfa16b6f4122b9b91e1c8b21a3f58cebd (patch)
tree2a1688419325be4932a9c145e8d9978950b37919 /reftable/stack.c
parentde9278127e107455fda269d2db280782d77e5eba (diff)
parent7cf65e266020f23d31863a1f9508f375be818071 (diff)
downloadgit-7041902dfa16b6f4122b9b91e1c8b21a3f58cebd.tar.gz
Merge branch 'ps/reftable-iterator-reuse'
Optimize reading random references out of the reftable backend by allowing reuse of iterator objects. * ps/reftable-iterator-reuse: refs/reftable: reuse iterators when reading refs reftable/merged: drain priority queue on reseek reftable/stack: add mechanism to notify callers on reload refs/reftable: refactor reflog expiry to use reftable backend refs/reftable: refactor reading symbolic refs to use reftable backend refs/reftable: read references via `struct reftable_backend` refs/reftable: figure out hash via `reftable_stack` reftable/stack: add accessor for the hash ID refs/reftable: handle reloading stacks in the reftable backend refs/reftable: encapsulate reftable stack
Diffstat (limited to 'reftable/stack.c')
-rw-r--r--reftable/stack.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/reftable/stack.c b/reftable/stack.c
index 10d45e89d0..59fd695a12 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -548,6 +548,10 @@ out:
close(fd);
free_names(names);
free_names(names_after);
+
+ if (st->opts.on_reload)
+ st->opts.on_reload(st->opts.on_reload_payload);
+
return err;
}
@@ -1791,3 +1795,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);
+}