]> git.ipfire.org Git - thirdparty/git.git/commit
sequencer: fix empty commit check when amending
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Fri, 22 Nov 2019 19:43:03 +0000 (19:43 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 23 Nov 2019 01:52:32 +0000 (10:52 +0900)
commit2d05ef2778b99e05e6a8a40c5b8d59a3c4ab1274
tree763f4ea28732dc1f34ac0e7c4274ec272bbb0825
parent4627bc777e9ade5e3a85d6b8e8630fc4b6e2f8f6
sequencer: fix empty commit check when amending

This fixes a regression introduced in 356ee4659b ("sequencer: try to
commit without forking 'git commit'", 2017-11-24). When amending a
commit try_to_commit() was using the wrong parent when checking if the
commit would be empty. When amending we need to check against HEAD^ not
HEAD.

t3403 may not seem like the natural home for the new tests but a further
patch series will improve the advice printed by `git commit`. That
series will mutate these tests to check that the advice includes
suggesting `rebase --skip` to skip the fixup that would empty the
commit.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3403-rebase-skip.sh