]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs/reftable: reload correct stack when creating reflog iter
authorPatrick Steinhardt <ps@pks.im>
Tue, 5 Mar 2024 12:10:55 +0000 (13:10 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Mar 2024 17:10:06 +0000 (09:10 -0800)
When creating a new reflog iterator, we first have to reload the stack
that the iterator is being created. This is done so that any concurrent
writes to the stack are reflected. But `reflog_iterator_for_stack()`
always reloads the main stack, which is wrong.

Fix this and reload the correct stack.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/reftable-backend.c

index 249a618b5a9cb942edb6b4b7d688c1653d45f80b..f04be942ac394dd5da98a18806204dffa8370d40 100644 (file)
@@ -1682,7 +1682,7 @@ static struct reftable_reflog_iterator *reflog_iterator_for_stack(struct reftabl
        if (ret)
                goto done;
 
-       ret = reftable_stack_reload(refs->main_stack);
+       ret = reftable_stack_reload(stack);
        if (ret < 0)
                goto done;