Skip to content
/ git Public
forked from git/git

Commit 456333e

Browse files
pks-tgitster
authored andcommitted
reftable/stack: unconditionally reload stack after commit
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 718a93e commit 456333e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reftable/stack.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ int reftable_addition_commit(struct reftable_addition *add)
585585
add->new_tables = NULL;
586586
add->new_tables_len = 0;
587587

588-
err = reftable_stack_reload(add->stack);
588+
err = reftable_stack_reload_maybe_reuse(add->stack, 1);
589589
if (err)
590590
goto done;
591591

0 commit comments

Comments
 (0)