]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/rebase-i-commit-cleanup-fix'
authorJunio C Hamano <gitster@pobox.com>
Wed, 10 Feb 2021 22:48:32 +0000 (14:48 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Feb 2021 22:48:32 +0000 (14:48 -0800)
When "git rebase -i" processes "fixup" insn, there is no reason to
clean up the commit log message, but we did the usual stripspace
processing.  This has been corrected.

* js/rebase-i-commit-cleanup-fix:
  rebase -i: do leave commit message intact in fixup! chains

1  2 
t/t3415-rebase-autosquash.sh

index e7087befd4e300edbd9b10d6935befbb1de23cc4,88040bc435238363ce8e444784e65fddeaf99da9..36f169d7f15559c0e7cd129365e404ec5ad99b03
@@@ -2,9 -2,6 +2,9 @@@
  
  test_description='auto squash'
  
 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 +
  . ./test-lib.sh
  
  . "$TEST_DIRECTORY"/lib-rebase.sh
@@@ -410,7 -407,7 +410,7 @@@ test_expect_success 'wrapped original s
  
  test_expect_success 'abort last squash' '
        test_when_finished "test_might_fail git rebase --abort" &&
 -      test_when_finished "git checkout master" &&
 +      test_when_finished "git checkout main" &&
  
        git checkout -b some-squashes &&
        git commit --allow-empty -m first &&
@@@ -443,4 -440,12 +443,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