diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-02-16 07:45:45 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-17 08:37:51 -0800 |
| commit | 0f2a0c507701f5b166de62ddfe23d48ed2d884e1 (patch) | |
| tree | 91bb67a6433d619dac1e20009c100459ebd18f5d /t | |
| parent | 76a3f28243ebb0be492f30210f2426a9f511f920 (diff) | |
| download | git-0f2a0c507701f5b166de62ddfe23d48ed2d884e1.tar.xz | |
builtin/history: check for merges before asking for user input
The replay infrastructure is not yet capable of replaying merge commits.
Unfortunately, we only notice that we're about to replay merges after we
have already asked the user for input, so any commit message that the
user may have written will be discarded in that case.
Fix this by checking whether the revwalk contains merge commits before
we ask for user input.
Adapt one of the tests that is expected to fail because of this check
to use false(1) as editor. If the editor had been executed by Git, it
would fail with the error message "Aborting commit as launching the
editor failed."
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
| -rwxr-xr-x | t/t3451-history-reword.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t3451-history-reword.sh b/t/t3451-history-reword.sh index 6775ed62f9..12a9a7d051 100755 --- a/t/t3451-history-reword.sh +++ b/t/t3451-history-reword.sh @@ -203,7 +203,7 @@ test_expect_success 'can reword a merge commit' ' # It is not possible to replay merge commits embedded in the # history (yet). - test_must_fail git history reword HEAD~ 2>err && + test_must_fail git -c core.editor=false history reword HEAD~ 2>err && test_grep "replaying merge commits is not supported yet" err && # But it is possible to reword a merge commit directly. |
