3 test_description='rebase should handle arbitrary git message'
6 . "$TEST_DIRECTORY"/lib-rebase.sh
9 This is an example of a commit log message
10 that does not conform to git commit convention.
12 It has two paragraphs, but its first paragraph is not friendly
13 to oneline summary format.
17 commit log message containing a diff
21 test_expect_success setup '
25 git add file1 file2 &&
27 git commit -m "Initial commit" &&
28 git branch diff-in-message &&
29 git branch empty-message-merge &&
31 git checkout -b multi-line-subject &&
37 git cat-file commit HEAD | sed -e "1,/^\$/d" >F0 &&
39 git checkout diff-in-message &&
40 echo "commit log message containing a diff" >G &&
44 git diff --cached >>G &&
48 git cat-file commit HEAD | sed -e "1,/^\$/d" >G0 &&
50 git checkout empty-message-merge &&
53 git commit --allow-empty-message -m "" &&
55 git checkout master &&
60 git commit -m "Second commit"
63 test_expect_success 'rebase commit with multi-line subject' '
65 git rebase master multi-line-subject &&
66 git cat-file commit HEAD | sed -e "1,/^\$/d" >F1 &&
72 test_expect_success 'rebase commit with diff in message' '
73 git rebase master diff-in-message &&
74 git cat-file commit HEAD | sed -e "1,/^$/d" >G1 &&
79 test_expect_success 'rebase -m commit with empty message' '
80 git rebase -m master empty-message-merge
83 test_expect_success 'rebase -i commit with empty message' '
84 git checkout diff-in-message &&
86 test_must_fail env FAKE_COMMIT_MESSAGE=" " FAKE_LINES="reword 1" \