diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2021-01-28 16:16:42 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-28 12:12:37 -0800 |
commit | f7d42ceec5265f6dbcaeb527657521b7ec8ddc94 (patch) | |
tree | d12d9ae0d8ae3189fa378a6c08125da20d705f57 /t | |
parent | Git 2.30 (diff) | |
download | tgif-f7d42ceec5265f6dbcaeb527657521b7ec8ddc94.tar.xz |
rebase -i: do leave commit message intact in fixup! chains
In 6e98de72c03 (sequencer (rebase -i): add support for the 'fixup' and
'squash' commands, 2017-01-02), this developer introduced a change of
behavior by mistake: when encountering a `fixup!` commit (or multiple
`fixup!` commits) without any `squash!` commit thrown in, the final `git
commit` was invoked with `--cleanup=strip`. Prior to that commit, the
commit command had been called without that `--cleanup` option.
Since we explicitly read the original commit message from a file in that
case, there is really no sense in forcing that clean-up.
We actually need to actively suppress that clean-up lest a configured
`commit.cleanup` may interfere with what we want to do: leave the commit
message unchanged.
Reported-by: Vojtěch Knyttl <vojtech@knyt.tl>
Helped-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t3415-rebase-autosquash.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh index 7bab6000dc..88040bc435 100755 --- a/t/t3415-rebase-autosquash.sh +++ b/t/t3415-rebase-autosquash.sh @@ -440,4 +440,12 @@ test_expect_success 'fixup a fixup' ' test XZWY = $(git show | tr -cd W-Z) ' +test_expect_success 'fixup does not clean up commit message' ' + oneline="#818" && + git commit --allow-empty -m "$oneline" && + git commit --fixup HEAD --allow-empty && + git -c commit.cleanup=strip rebase -ki --autosquash HEAD~2 && + test "$oneline" = "$(git show -s --format=%s)" +' + test_done |