3 test_description
='rebase should handle arbitrary git message'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 TEST_PASSES_SANITIZE_LEAK
=true
10 .
"$TEST_DIRECTORY"/lib-rebase.sh
13 This is an example of a commit log message
14 that does not conform to git commit convention.
16 It has two paragraphs
, but its first paragraph is not friendly
17 to oneline summary format.
21 commit log message containing a
diff
25 test_expect_success setup
'
29 git add file1 file2 &&
31 git commit -m "Initial commit" &&
32 git branch diff-in-message &&
33 git branch empty-message-merge &&
35 git checkout -b multi-line-subject &&
41 git cat-file commit HEAD | sed -e "1,/^\$/d" >F0 &&
43 git checkout diff-in-message &&
44 echo "commit log message containing a diff" >G &&
48 git diff --cached >>G &&
52 git cat-file commit HEAD | sed -e "1,/^\$/d" >G0 &&
54 git checkout empty-message-merge &&
57 git commit --allow-empty-message -m "" &&
64 git commit -m "Second commit"
67 test_expect_success
'rebase commit with multi-line subject' '
69 git rebase main multi-line-subject &&
70 git cat-file commit HEAD | sed -e "1,/^\$/d" >F1 &&
76 test_expect_success
'rebase commit with diff in message' '
77 git rebase main diff-in-message &&
78 git cat-file commit HEAD | sed -e "1,/^$/d" >G1 &&
83 test_expect_success
'rebase -m commit with empty message' '
84 git rebase -m main empty-message-merge
87 test_expect_success
'rebase -i commit with empty message' '
88 git checkout diff-in-message &&
90 test_must_fail env FAKE_COMMIT_MESSAGE=" " FAKE_LINES="reword 1" \