diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-10-15 10:29:31 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-15 10:29:31 -0700 |
| commit | ac57c870aaaf2b7964d4f2d8f607f16a22fba608 (patch) | |
| tree | 7f6babaf61fd96c211cbec10083fbb78412a5bc1 /t | |
| parent | Merge branch 'jk/add-i-color' into maint-2.51 (diff) | |
| parent | sequencer: remove VERBATIM_MSG flag (diff) | |
| download | git-ac57c870aaaf2b7964d4f2d8f607f16a22fba608.tar.gz git-ac57c870aaaf2b7964d4f2d8f607f16a22fba608.zip | |
Merge branch 'pw/rebase-i-cleanup-fix' into maint-2.51
"git rebase -i" failed to clean-up the commit log message when the
command commits the final one in a chain of "fixup" commands, which
has been corrected.
* pw/rebase-i-cleanup-fix:
sequencer: remove VERBATIM_MSG flag
rebase -i: respect commit.cleanup when picking fixups
Diffstat (limited to 't')
| -rwxr-xr-x | t/t3415-rebase-autosquash.sh | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh index 5d093e3a7a..5033411a43 100755 --- a/t/t3415-rebase-autosquash.sh +++ b/t/t3415-rebase-autosquash.sh @@ -486,12 +486,28 @@ 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_expect_success 'pick and fixup respect commit.cleanup' ' + git reset --hard base && + test_commit --no-tag "fixup! second commit" file1 fixup && + test_commit something && + write_script .git/hooks/prepare-commit-msg <<-\EOF && + printf "\n# Prepared\n" >> "$1" + EOF + git rebase -i --autosquash HEAD~3 && + test_commit_message HEAD~1 <<-\EOF && + second commit + + # Prepared + EOF + test_commit_message HEAD <<-\EOF && + something + + # Prepared + EOF + git reset --hard something && + git -c commit.cleanup=strip rebase -i --autosquash HEAD~3 && + test_commit_message HEAD~1 -m "second commit" && + test_commit_message HEAD -m "something" ' test_done |
