]> git.ipfire.org Git - thirdparty/git.git/blame - t/t3405-rebase-malformed.sh
Merge branch 'jk/complete-commit-c' into maint
[thirdparty/git.git] / t / t3405-rebase-malformed.sh
CommitLineData
d7f6bae2
JH
1#!/bin/sh
2
a2309494 3test_description='rebase should handle arbitrary git message'
d7f6bae2
JH
4
5. ./test-lib.sh
6
7cat >F <<\EOF
8This is an example of a commit log message
9that does not conform to git commit convention.
10
11It has two paragraphs, but its first paragraph is not friendly
12to oneline summary format.
13EOF
14
a2309494
MZ
15cat >G <<\EOF
16commit log message containing a diff
17EOF
18
19
d7f6bae2
JH
20test_expect_success setup '
21
22 >file1 &&
23 >file2 &&
24 git add file1 file2 &&
25 test_tick &&
26 git commit -m "Initial commit" &&
a2309494 27 git branch diff-in-message
d7f6bae2 28
a2309494 29 git checkout -b multi-line-subject &&
d7f6bae2
JH
30 cat F >file2 &&
31 git add file2 &&
32 test_tick &&
33 git commit -F F &&
34
35 git cat-file commit HEAD | sed -e "1,/^\$/d" >F0 &&
36
a2309494
MZ
37 git checkout diff-in-message &&
38 echo "commit log message containing a diff" >G &&
39 echo "" >>G
40 cat G >file2 &&
41 git add file2 &&
42 git diff --cached >>G &&
43 test_tick &&
44 git commit -F G &&
45
46 git cat-file commit HEAD | sed -e "1,/^\$/d" >G0 &&
47
d7f6bae2
JH
48 git checkout master &&
49
50 echo One >file1 &&
51 test_tick &&
52 git add file1 &&
53 git commit -m "Second commit"
54'
55
a2309494 56test_expect_success 'rebase commit with multi-line subject' '
d7f6bae2 57
a2309494 58 git rebase master multi-line-subject &&
d7f6bae2
JH
59 git cat-file commit HEAD | sed -e "1,/^\$/d" >F1 &&
60
82ebb0b6
JK
61 test_cmp F0 F1 &&
62 test_cmp F F0
d7f6bae2
JH
63'
64
a2309494
MZ
65test_expect_success 'rebase commit with diff in message' '
66 git rebase master diff-in-message &&
67 git cat-file commit HEAD | sed -e "1,/^$/d" >G1 &&
68 test_cmp G0 G1 &&
69 test_cmp G G0
70'
71
d7f6bae2 72test_done