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
9 . "$TEST_DIRECTORY"/lib-rebase.sh
12 This is an example of a commit log message
13 that does not conform to git commit convention.
15 It has two paragraphs, but its first paragraph is not friendly
16 to oneline summary format.
20 commit log message containing a diff
24 test_expect_success setup '
28 git add file1 file2 &&
30 git commit -m "Initial commit" &&
31 git branch diff-in-message &&
32 git branch empty-message-merge &&
34 git checkout -b multi-line-subject &&
40 git cat-file commit HEAD | sed -e "1,/^\$/d" >F0 &&
42 git checkout diff-in-message &&
43 echo "commit log message containing a diff" >G &&
47 git diff --cached >>G &&
51 git cat-file commit HEAD | sed -e "1,/^\$/d" >G0 &&
53 git checkout empty-message-merge &&
56 git commit --allow-empty-message -m "" &&
63 git commit -m "Second commit"
66 test_expect_success 'rebase commit with multi-line subject' '
68 git rebase main multi-line-subject &&
69 git cat-file commit HEAD | sed -e "1,/^\$/d" >F1 &&
75 test_expect_success 'rebase commit with diff in message' '
76 git rebase main diff-in-message &&
77 git cat-file commit HEAD | sed -e "1,/^$/d" >G1 &&
82 test_expect_success 'rebase -m commit with empty message' '
83 git rebase -m main empty-message-merge
86 test_expect_success 'rebase -i commit with empty message' '
87 git checkout diff-in-message &&
89 test_must_fail env FAKE_COMMIT_MESSAGE=" " FAKE_LINES="reword 1" \