aboutsummaryrefslogtreecommitdiffstats
path: root/sequencer.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-01-19 11:40:04 +0100
committerJunio C Hamano <gitster@pobox.com>2024-01-19 11:10:41 -0800
commitbb02e95f3b25d933272bcf9d6883828d26271f69 (patch)
treee06d8d58cd0654209b25de8e18adb0bba0f0b63f /sequencer.c
parent821f6632b091dc59562f74a0c74005b34319a2e7 (diff)
downloadgit-bb02e95f3b25d933272bcf9d6883828d26271f69.tar.gz
sequencer: delete REBASE_HEAD in correct repo when picking commits
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@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c3
1 files changed, 2 insertions, 1 deletions
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)