When picking commits, we delete some state before executing the next sequencer action on interactive rebases. But while we use the correct repository to calculate paths to state files that need deletion, we use the repo-less `delete_ref()` function to delete REBASE_HEAD. Thus, if the sequencer ran in a different repository than `the_repository`, we would end up deleting the ref in the wrong repository. Fix this by using `refs_delete_ref()` instead. Signed-off-by: Patrick Steinhardt <ps@xxxxxx> --- sequencer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index b9cbc290ea..6f620f5717 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4767,7 +4767,8 @@ static int pick_commits(struct repository *r, unlink(rebase_path_author_script()); unlink(git_path_merge_head(r)); unlink(git_path_auto_merge(r)); - delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF); + refs_delete_ref(get_main_ref_store(r), "", "REBASE_HEAD", + NULL, REF_NO_DEREF); if (item->command == TODO_BREAK) { if (!opts->verbose) -- 2.43.GIT
Attachment:
signature.asc
Description: PGP signature