]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reftable/stack: unconditionally reload stack after commit
authorPatrick Steinhardt <ps@pks.im>
Thu, 18 Jan 2024 13:41:51 +0000 (14:41 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Jan 2024 20:02:09 +0000 (12:02 -0800)
After we have committed an addition to the reftable stack we call
`reftable_stack_reload()` to reload the stack and thus reflect the
changes that were just added. This function will only conditionally
reload the stack in case `stack_uptodate()` tells us that the stack
needs reloading. This check is wasteful though because we already know
that the stack needs reloading.

Call `reftable_stack_reload_maybe_reuse()` instead, which will
unconditionally reload the stack. This is merely a conceptual fix, the
code in question was not found to cause any problems in practice.

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

index c28d82299d8082ebb1d3c19d9dbc763b2ab9f8ad..705cfb6caacc67f802c83174b8e1eae4b1ebc264 100644 (file)
@@ -585,7 +585,7 @@ int reftable_addition_commit(struct reftable_addition *add)
        add->new_tables = NULL;
        add->new_tables_len = 0;
 
-       err = reftable_stack_reload(add->stack);
+       err = reftable_stack_reload_maybe_reuse(add->stack, 1);
        if (err)
                goto done;