diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2022-10-12 09:35:07 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-10-17 12:55:03 -0700 |
commit | da1d63363f13d4d65c59564c74fd8dd598b39c49 (patch) | |
tree | 29741a3e45957c2f3c7a31e7b6baf720f640ce09 /t/t3406-rebase-message.sh | |
parent | 4e5e1b4b616f0354218ff2e2ff3c71e4c730bbe1 (diff) | |
download | git-da1d63363f13d4d65c59564c74fd8dd598b39c49.tar.gz |
rebase --merge: fix reflog when continuing
The reflog message for a conflict resolution committed by "rebase
--continue" looks like
rebase (continue): commit subject line
Unfortunately the reflog message each subsequent pick look like
rebase (continue) (pick): commit subject line
Fix this by setting the reflog message for "rebase --continue" in
sequencer_continue() so it does not affect subsequent commits. This
introduces a memory leak similar to the one leaking GIT_REFLOG_ACTION
in pick_commits(). Both of these will be fixed in a future series that
stops the sequencer calling setenv().
If we fail to commit the staged changes then we error out so
GIT_REFLOG_ACTION does not need to be reset in that case.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3406-rebase-message.sh')
-rwxr-xr-x | t/t3406-rebase-message.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh index 5253dd1551..3ca2fbb0d5 100755 --- a/t/t3406-rebase-message.sh +++ b/t/t3406-rebase-message.sh @@ -17,6 +17,7 @@ test_expect_success 'setup' ' git checkout -b conflicts O && test_commit P && + test_commit conflict-X fileX && test_commit Q && git checkout -b topic O && @@ -107,13 +108,17 @@ test_reflog () { GIT_REFLOG_ACTION="$reflog_action" && export GIT_REFLOG_ACTION fi && - git rebase $mode main + test_must_fail git rebase $mode main && + echo resolved >fileX && + git add fileX && + git rebase --continue ) && - git log -g --format=%gs -4 >actual && + git log -g --format=%gs -5 >actual && write_reflog_expect <<-EOF && ${reflog_action:-rebase} (finish): returning to refs/heads/conflicts ${reflog_action:-rebase} (pick): Q + ${reflog_action:-rebase} (continue): conflict-X ${reflog_action:-rebase} (pick): P ${reflog_action:-rebase} (start): checkout main EOF |