]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/history: check for merges before asking for user input
authorPatrick Steinhardt <ps@pks.im>
Mon, 16 Feb 2026 06:45:45 +0000 (07:45 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Feb 2026 16:37:51 +0000 (08:37 -0800)
commit0f2a0c507701f5b166de62ddfe23d48ed2d884e1
tree91bb67a6433d619dac1e20009c100459ebd18f5d
parent76a3f28243ebb0be492f30210f2426a9f511f920
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>
builtin/history.c
t/t3451-history-reword.sh