{"thread":{"id":"66678","subject":"[PATCH 0/3] sequencer: fix cleanup of REBASE_HEAD and AUTO_MERGE","startedAt":"2026-10-27T10:57:54Z","lastAt":"2026-10-27T20:11:40Z","messageCount":7,"participants":["Phillip Wood","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"556476","messageId":"cover.1793098652.git.phillip.wood@dunelm.org.uk","threadId":"66678","inReplyTo":null,"subject":"[PATCH 0/3] sequencer: fix cleanup of REBASE_HEAD and AUTO_MERGE","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-27T10:57:54Z","receivedAt":"2026-10-27T10:57:54Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"We had an error report [1] that REBASE_HEAD was still present after\na rebase had finished. While looking at that I noticed the same could\nhappen to AUTO_MERGE. These patches ensure those refs are removed by\n\"git rebase --continue\" so that they are not left behind after the\nrebase has finished.\n\nThanks to Long for the bug report and Matt for the confirmation\n\n[1] https://lore.kernel.org/git/edfc868b-6be6-4871-a539-e70791db216d@mail.ru\n\nbase-commit: 7e34d8174dcda3435d1404c9a30bef46afe6c13e\nPublished-As: https://github.com/phillipwood/git/releases/tag/pw%2Fsequencer-delete-REBASE_HEAD%2Fv1\nView-Changes-At: https://github.com/phillipwood/git/compare/7e34d8174...2fcb42a08\nFetch-It-Via: git fetch https://github.com/phillipwood/git pw/sequencer-delete-REBASE_HEAD/v1\n\n\nPhillip Wood (3):\n  test_ref_missing(): improve error message\n  sequencer: remove REBASE_HEAD at the end of a rebase\n  sequencer: remove AUTO_MERGE at the end of a rebase\n\n sequencer.c                | 13 ++++++++-----\n t/t3403-rebase-skip.sh     |  6 +++++-\n t/t3407-rebase-abort.sh    |  4 ++++\n t/t3418-rebase-continue.sh | 10 ++++++++--\n t/test-lib-functions.sh    |  6 ++++--\n 5 files changed, 29 insertions(+), 10 deletions(-)\n\n-- \n2.56.0.336.g97505d19352\n\n\n"},{"id":"556477","messageId":"e246ee6f3b11c231580752b6c94a57f31f449955.1793098652.git.phillip.wood@dunelm.org.uk","threadId":"66678","inReplyTo":"cover.1793098652.git.phillip.wood@dunelm.org.uk","subject":"[PATCH 1/3] test_ref_missing(): improve error message","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-27T10:57:55Z","receivedAt":"2026-10-27T10:57:55Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"From: Phillip Wood <phillip.wood@dunelm.org.uk>\n\nIf the ref being checked exists, then test_ref_missing() does not print\nthe name of the ref in the error message. So, if there is more than\none call to test_ref_missing() in a test, it is hard to understand\nwhich one failed by looking at the test output. Fix that by printing\nthe name of the ref that erroneously exists.\n\nSigned-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n---\n t/test-lib-functions.sh | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 09a41d51adc..b56b4f0a6c8 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -292,18 +292,20 @@ test_ref_exists () {\n # a reference. This is preferable to `! test_ref_exists` as this function is\n # able to distinguish actually-missing references from other, generic errors.\n test_ref_missing () {\n+\tlocal refname\n+\teval refname=\"\\$$#\"\n \ttest_ref_exists \"$@\"\n \tcase \"$?\" in\n \t2)\n \t\t# This is the good case.\n \t\treturn 0\n \t\t;;\n \t0)\n-\t\techo >&4 \"test_ref_missing: reference exists\"\n+\t\techo >&4 \"test_ref_missing: '$refname' exists\"\n \t\treturn 1\n \t\t;;\n \t*)\n-\t\techo >&4 \"test_ref_missing: generic error\"\n+\t\techo >&4 \"test_ref_missing: generic error while checking '$refname'\"\n \t\treturn 1\n \t\t;;\n \tesac\n-- \n2.56.0.336.g97505d19352\n\n\n"},{"id":"556478","messageId":"ba13c74698d2af3bd2ababbf2ff1a9738a81d501.1793098652.git.phillip.wood@dunelm.org.uk","threadId":"66678","inReplyTo":"cover.1793098652.git.phillip.wood@dunelm.org.uk","subject":"[PATCH 2/3] sequencer: remove REBASE_HEAD at the end of a rebase","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-27T10:57:56Z","receivedAt":"2026-10-27T10:57:56Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"From: Phillip Wood <phillip.wood@dunelm.org.uk>\n\nWhen \"git rebase\" stops for an \"edit\" command, a rescheduled command,\nor for the user to resolve conflicts, it creates a ref called\nREBASE_HEAD pointing to the commit that is being picked. The ref is\ndeleted at the start of each iteration of the loop that picks commits,\nbut not after the loop ends. That means if there are conflicts on the\nlast commit to be picked, REBASE_HEAD is left behind after the rebase\nfinishes. Fix that by deleting REBASE_HEAD where it is created in\ndo_commit() if the commit succeeds, and before we enter the loop in\npick_commits() so that it is removed when continuing a rebase after\na conflict resolution or failed commit.\n\nSeveral existing tests are extended to check that REBASE_HEAD is\npresent when we stop for conflicts and is absent when the rebase\nfinishes.\n\nReported-by: Long 76 <long76.git@mail.ru>\nReported-by: Matt Hunter <m@lfurio.us>\nSigned-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n---\n sequencer.c                | 9 ++++++---\n t/t3403-rebase-skip.sh     | 4 +++-\n t/t3407-rebase-abort.sh    | 2 ++\n t/t3418-rebase-continue.sh | 8 ++++++--\n 4 files changed, 17 insertions(+), 6 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 2ac78e15b89..2d6a5f525c7 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1781,7 +1781,10 @@ static int do_commit(struct repository *r,\n \t\tif (is_rebase_i(opts) && oid)\n \t\t\tif (write_rebase_head(oid))\n \t\t\t    return -1;\n-\t\treturn run_git_commit(msg_file, reflog_action, opts, flags);\n+\t\tres = run_git_commit(msg_file, reflog_action, opts, flags);\n+\t\tif (!res && is_rebase_i(opts) && oid)\n+\t\t\trefs_delete_ref(get_main_ref_store(r), \"\", \"REBASE_HEAD\",\n+\t\t\t\t\tNULL, REF_NO_DEREF);\n \t}\n \n \treturn res;\n@@ -5178,6 +5181,8 @@ static int pick_commits(struct repository *r,\n \tunlink(rebase_path_amend());\n \tunlink(rebase_path_patch());\n \tunlink(git_path_merge_labels(r));\n+\trefs_delete_ref(get_main_ref_store(r), \"\", \"REBASE_HEAD\", NULL,\n+\t\t\tREF_NO_DEREF);\n \n \twhile (todo_list->current < todo_list->nr) {\n \t\tstruct todo_item *item = todo_list->items + todo_list->current;\n@@ -5206,8 +5211,6 @@ static int pick_commits(struct repository *r,\n \t\t\tunlink(git_path_merge_head(r));\n \t\t\trefs_delete_ref(get_main_ref_store(r), \"\", \"AUTO_MERGE\",\n \t\t\t\t\tNULL, REF_NO_DEREF);\n-\t\t\trefs_delete_ref(get_main_ref_store(r), \"\", \"REBASE_HEAD\",\n-\t\t\t\t\tNULL, REF_NO_DEREF);\n \n \t\t\tif (item->command == TODO_BREAK) {\n \t\t\t\tif (!opts->verbose)\ndiff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh\nindex a1911c4a9d6..a2a5ac8ae01 100755\n--- a/t/t3403-rebase-skip.sh\n+++ b/t/t3403-rebase-skip.sh\n@@ -97,10 +97,12 @@ test_expect_success 'moved back to branch correctly' '\n \n test_debug 'gitk --all & sleep 1'\n \n-test_expect_success 'skipping final pick removes .git/MERGE_MSG' '\n+test_expect_success 'skipping final pick removes REBASE_HEAD & .git/MERGE_MSG' '\n \ttest_must_fail git rebase --onto hello reverted-goodbye^ \\\n \t\treverted-goodbye &&\n+\ttest_cmp_rev reverted-goodbye REBASE_HEAD &&\n \tgit rebase --skip &&\n+\ttest_ref_missing REBASE_HEAD &&\n \ttest_path_is_missing .git/MERGE_MSG\n '\n \ndiff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\nindex 9f49c4228b6..1703b5ae9b5 100755\n--- a/t/t3407-rebase-abort.sh\n+++ b/t/t3407-rebase-abort.sh\n@@ -35,7 +35,9 @@ testrebase() {\n \t\tgit reset --hard pre-rebase &&\n \t\ttest_must_fail git rebase$type main &&\n \t\ttest_path_is_dir \"$state_dir\" &&\n+\t\ttest_cmp_rev d REBASE_HEAD &&\n \t\tgit rebase --abort &&\n+\t\ttest_ref_missing REBASE_HEAD &&\n \t\tcheck_head &&\n \t\ttest_path_is_missing \"$state_dir\"\n \t'\ndiff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh\nindex 8c43ef64fce..f35cd130921 100755\n--- a/t/t3418-rebase-continue.sh\n+++ b/t/t3418-rebase-continue.sh\n@@ -28,7 +28,9 @@ test_expect_success 'merge based rebase --continue with works with touched file'\n \n \tFAKE_LINES=\"edit 1\" git rebase -i HEAD^ &&\n \ttest-tool chmtime =-60 F1 &&\n-\tgit rebase --continue\n+\ttest_cmp_rev commit-new-file-F2 REBASE_HEAD &&\n+\tgit rebase --continue &&\n+\ttest_ref_missing REBASE_HEAD\n '\n \n test_expect_success 'merge based rebase --continue removes .git/MERGE_MSG' '\n@@ -37,8 +39,10 @@ test_expect_success 'merge based rebase --continue removes .git/MERGE_MSG' '\n \ttest_must_fail git rebase --onto main HEAD^ &&\n \tgit read-tree --reset -u HEAD &&\n \ttest_path_is_file .git/MERGE_MSG &&\n+\ttest_cmp_rev commit-new-file-F2-on-topic-branch REBASE_HEAD &&\n \tgit rebase --continue &&\n-\ttest_path_is_missing .git/MERGE_MSG\n+\ttest_path_is_missing .git/MERGE_MSG &&\n+\ttest_ref_missing REBASE_HEAD\n '\n \n test_expect_success 'apply based rebase --continue works with touched file' '\n-- \n2.56.0.336.g97505d19352\n\n\n"},{"id":"556479","messageId":"2fcb42a0858dffe45241cbced066dd0c0f5da76f.1793098652.git.phillip.wood@dunelm.org.uk","threadId":"66678","inReplyTo":"cover.1793098652.git.phillip.wood@dunelm.org.uk","subject":"[PATCH 3/3] sequencer: remove AUTO_MERGE at the end of a rebase","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-27T10:57:57Z","receivedAt":"2026-10-27T10:57:57Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"From: Phillip Wood <phillip.wood@dunelm.org.uk>\n\nIf there are conflicts when picking a commit, the merge machinery\ncreates a ref called AUTO_MERGE that the user can use to compare their\nconflict resolution to the conflicted result. The sequencer tries to\nremove that ref on every iteration of the loop that picks commits,\nbut it is only written if we stop for conflicts, so it only needs\nto be removed when we enter the loop, not on every iteration. The\nref is not removed after the loop has finished, which means that if\nthe last pick has conflicts it is left behind after the rebase has\nfinished. Fix this by removing the ref before the start of the loop\nin pick_commits() as the last commit did for REBASE_HEAD. The tests\nmodified by the last commit are extended to check AUTO_MERGE as well.\n\nSigned-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n---\n sequencer.c                | 4 ++--\n t/t3403-rebase-skip.sh     | 2 ++\n t/t3407-rebase-abort.sh    | 2 ++\n t/t3418-rebase-continue.sh | 2 ++\n 4 files changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 2d6a5f525c7..7a88b6530bf 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -5181,6 +5181,8 @@ static int pick_commits(struct repository *r,\n \tunlink(rebase_path_amend());\n \tunlink(rebase_path_patch());\n \tunlink(git_path_merge_labels(r));\n+\trefs_delete_ref(get_main_ref_store(r), \"\", \"AUTO_MERGE\", NULL,\n+\t\t\tREF_NO_DEREF);\n \trefs_delete_ref(get_main_ref_store(r), \"\", \"REBASE_HEAD\", NULL,\n \t\t\tREF_NO_DEREF);\n \n@@ -5209,8 +5211,6 @@ static int pick_commits(struct repository *r,\n \t\t\t}\n \t\t\tunlink(rebase_path_author_script());\n \t\t\tunlink(git_path_merge_head(r));\n-\t\t\trefs_delete_ref(get_main_ref_store(r), \"\", \"AUTO_MERGE\",\n-\t\t\t\t\tNULL, REF_NO_DEREF);\n \n \t\t\tif (item->command == TODO_BREAK) {\n \t\t\t\tif (!opts->verbose)\ndiff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh\nindex a2a5ac8ae01..d4fcfe567c4 100755\n--- a/t/t3403-rebase-skip.sh\n+++ b/t/t3403-rebase-skip.sh\n@@ -100,8 +100,10 @@ test_debug 'gitk --all & sleep 1'\n test_expect_success 'skipping final pick removes REBASE_HEAD & .git/MERGE_MSG' '\n \ttest_must_fail git rebase --onto hello reverted-goodbye^ \\\n \t\treverted-goodbye &&\n+\tgit show-ref --verify AUTO_MERGE &&\n \ttest_cmp_rev reverted-goodbye REBASE_HEAD &&\n \tgit rebase --skip &&\n+\ttest_ref_missing AUTO_MERGE &&\n \ttest_ref_missing REBASE_HEAD &&\n \ttest_path_is_missing .git/MERGE_MSG\n '\ndiff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\nindex 1703b5ae9b5..fdd9a2b9f61 100755\n--- a/t/t3407-rebase-abort.sh\n+++ b/t/t3407-rebase-abort.sh\n@@ -35,8 +35,10 @@ testrebase() {\n \t\tgit reset --hard pre-rebase &&\n \t\ttest_must_fail git rebase$type main &&\n \t\ttest_path_is_dir \"$state_dir\" &&\n+\t\tgit show-ref --verify AUTO_MERGE &&\n \t\ttest_cmp_rev d REBASE_HEAD &&\n \t\tgit rebase --abort &&\n+\t\ttest_ref_missing AUTO_MERGE &&\n \t\ttest_ref_missing REBASE_HEAD &&\n \t\tcheck_head &&\n \t\ttest_path_is_missing \"$state_dir\"\ndiff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh\nindex f35cd130921..1c26bf5de54 100755\n--- a/t/t3418-rebase-continue.sh\n+++ b/t/t3418-rebase-continue.sh\n@@ -39,9 +39,11 @@ test_expect_success 'merge based rebase --continue removes .git/MERGE_MSG' '\n \ttest_must_fail git rebase --onto main HEAD^ &&\n \tgit read-tree --reset -u HEAD &&\n \ttest_path_is_file .git/MERGE_MSG &&\n+\tgit show-ref --verify AUTO_MERGE &&\n \ttest_cmp_rev commit-new-file-F2-on-topic-branch REBASE_HEAD &&\n \tgit rebase --continue &&\n \ttest_path_is_missing .git/MERGE_MSG &&\n+\ttest_ref_missing AUTO_MERGE &&\n \ttest_ref_missing REBASE_HEAD\n '\n \n-- \n2.56.0.336.g97505d19352\n\n\n"},{"id":"556574","messageId":"xmqqld7ij4lg.fsf@gitster.g","threadId":"66678","inReplyTo":"e246ee6f3b11c231580752b6c94a57f31f449955.1793098652.git.phillip.wood@dunelm.org.uk","subject":"Re: [PATCH 1/3] test_ref_missing(): improve error message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-27T20:00:59Z","receivedAt":"2026-10-27T20:00:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> From: Phillip Wood <phillip.wood@dunelm.org.uk>\n>\n> If the ref being checked exists, then test_ref_missing() does not print\n> the name of the ref in the error message. So, if there is more than\n> one call to test_ref_missing() in a test, it is hard to understand\n> which one failed by looking at the test output. Fix that by printing\n> the name of the ref that erroneously exists.\n>\n> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> ---\n>  t/test-lib-functions.sh | 6 ++++--\n>  1 file changed, 4 insertions(+), 2 deletions(-)\n\nMakes sense.\n\n> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\n> index 09a41d51adc..b56b4f0a6c8 100644\n> --- a/t/test-lib-functions.sh\n> +++ b/t/test-lib-functions.sh\n> @@ -292,18 +292,20 @@ test_ref_exists () {\n>  # a reference. This is preferable to `! test_ref_exists` as this function is\n>  # able to distinguish actually-missing references from other, generic errors.\n>  test_ref_missing () {\n> +\tlocal refname\n> +\teval refname=\"\\$$#\"\n\nOK, test_ref_exists is defined immediately before, so it probably is\nsafe to assume that the last parameter is the refname argument like\nthis patch does.  And it would make the failure output much easier\nto understand.\n\n> -\t\techo >&4 \"test_ref_missing: reference exists\"\n> +\t\techo >&4 \"test_ref_missing: '$refname' exists\"\n\nThanks.\n\n"},{"id":"556575","messageId":"xmqqh5i6j462.fsf@gitster.g","threadId":"66678","inReplyTo":"ba13c74698d2af3bd2ababbf2ff1a9738a81d501.1793098652.git.phillip.wood@dunelm.org.uk","subject":"Re: [PATCH 2/3] sequencer: remove REBASE_HEAD at the end of a rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-27T20:10:13Z","receivedAt":"2026-10-27T20:10:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> Several existing tests are extended to check that REBASE_HEAD is\n> present when we stop for conflicts and is absent when the rebase\n> finishes.\n\nGood.\n\n> diff --git a/sequencer.c b/sequencer.c\n> index 2ac78e15b89..2d6a5f525c7 100644\n> --- a/sequencer.c\n> +++ b/sequencer.c\n> @@ -1781,7 +1781,10 @@ static int do_commit(struct repository *r,\n>  \t\tif (is_rebase_i(opts) && oid)\n>  \t\t\tif (write_rebase_head(oid))\n>  \t\t\t    return -1;\n> -\t\treturn run_git_commit(msg_file, reflog_action, opts, flags);\n> +\t\tres = run_git_commit(msg_file, reflog_action, opts, flags);\n> +\t\tif (!res && is_rebase_i(opts) && oid)\n> +\t\t\trefs_delete_ref(get_main_ref_store(r), \"\", \"REBASE_HEAD\",\n> +\t\t\t\t\tNULL, REF_NO_DEREF);\n>  \t}\n>  \n>  \treturn res;\n> @@ -5178,6 +5181,8 @@ static int pick_commits(struct repository *r,\n>  \tunlink(rebase_path_amend());\n>  \tunlink(rebase_path_patch());\n>  \tunlink(git_path_merge_labels(r));\n> +\trefs_delete_ref(get_main_ref_store(r), \"\", \"REBASE_HEAD\", NULL,\n> +\t\t\tREF_NO_DEREF);\n>  \n>  \twhile (todo_list->current < todo_list->nr) {\n>  \t\tstruct todo_item *item = todo_list->items + todo_list->current;\n> @@ -5206,8 +5211,6 @@ static int pick_commits(struct repository *r,\n>  \t\t\tunlink(git_path_merge_head(r));\n>  \t\t\trefs_delete_ref(get_main_ref_store(r), \"\", \"AUTO_MERGE\",\n>  \t\t\t\t\tNULL, REF_NO_DEREF);\n> -\t\t\trefs_delete_ref(get_main_ref_store(r), \"\", \"REBASE_HEAD\",\n> -\t\t\t\t\tNULL, REF_NO_DEREF);\n>  \n>  \t\t\tif (item->command == TODO_BREAK) {\n>  \t\t\t\tif (!opts->verbose)\n\nThe patch is a bit dense (not a fault of the patch, but the blame\nlargely lies on the overly long functions involved with multi-level\ncallchain), but the idea is that the existing removal in the loop\ninside pick_commits() may not trigger if the user resumes (via\n\"--continue\" or \"--skip\") with an exhausted todo_list and that would\nleave the REBASE_HEAD file behind, so we remove at the beginning of\npick_commits() before entering the loop, and also in do_commit(),\nwhich is called deep inside the callchain from the loop to handle\none step, immediately before it returns on successful commit.\n\nWhich makes perfect sense.  The new tests seems to cover these cases\nadequately, too.\n\nThanks.\n\n"},{"id":"556576","messageId":"xmqqcxsuj43n.fsf@gitster.g","threadId":"66678","inReplyTo":"2fcb42a0858dffe45241cbced066dd0c0f5da76f.1793098652.git.phillip.wood@dunelm.org.uk","subject":"Re: [PATCH 3/3] sequencer: remove AUTO_MERGE at the end of a rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-27T20:11:40Z","receivedAt":"2026-10-27T20:11:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> From: Phillip Wood <phillip.wood@dunelm.org.uk>\n>\n> If there are conflicts when picking a commit, the merge machinery\n> creates a ref called AUTO_MERGE that the user can use to compare their\n> conflict resolution to the conflicted result. The sequencer tries to\n> remove that ref on every iteration of the loop that picks commits,\n> but it is only written if we stop for conflicts, so it only needs\n> to be removed when we enter the loop, not on every iteration. The\n> ref is not removed after the loop has finished, which means that if\n> the last pick has conflicts it is left behind after the rebase has\n> finished. Fix this by removing the ref before the start of the loop\n> in pick_commits() as the last commit did for REBASE_HEAD. The tests\n> modified by the last commit are extended to check AUTO_MERGE as well.\n\nNice observation.  The patch is surprisingly short and to the point.\n\nOverall looking very good.\n\nThanks.\n\n"}]}