]>
Commit | Line | Data |
---|---|---|
5e835cac JH |
1 | #!/bin/sh |
2 | ||
3 | test_description='rebasing a commit with multi-line first paragraph.' | |
4 | ||
d1c02d93 | 5 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
334afbc7 JS |
6 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
7 | ||
5e835cac JH |
8 | . ./test-lib.sh |
9 | ||
10 | test_expect_success setup ' | |
11 | ||
12 | >file && | |
13 | git add file && | |
14 | test_tick && | |
15 | git commit -m initial && | |
16 | ||
17 | echo hello >file && | |
18 | test_tick && | |
19 | git commit -a -m "A sample commit log message that has a long | |
20 | summary that spills over multiple lines. | |
21 | ||
a48fcd83 | 22 | But otherwise with a sane description." && |
5e835cac JH |
23 | |
24 | git branch side && | |
25 | ||
26 | git reset --hard HEAD^ && | |
27 | >elif && | |
28 | git add elif && | |
29 | test_tick && | |
ed5144d7 | 30 | git commit -m second && |
5e835cac | 31 | |
ed5144d7 GH |
32 | git checkout -b side2 && |
33 | >afile && | |
34 | git add afile && | |
35 | test_tick && | |
36 | git commit -m third && | |
37 | echo hello >afile && | |
38 | test_tick && | |
39 | git commit -a -m fourth && | |
40 | git checkout -b side-merge && | |
41 | git reset --hard HEAD^^ && | |
42 | git merge --no-ff -m "A merge commit log message that has a long | |
43 | summary that spills over multiple lines. | |
44 | ||
45 | But otherwise with a sane description." side2 && | |
46 | git branch side-merge-original | |
5e835cac JH |
47 | ' |
48 | ||
49 | test_expect_success rebase ' | |
50 | ||
51 | git checkout side && | |
d1c02d93 | 52 | git rebase main && |
9524cf29 SB |
53 | git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && |
54 | git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect && | |
5e835cac JH |
55 | test_cmp expect actual |
56 | ||
ed5144d7 | 57 | ' |
11aad464 | 58 | test_expect_success REBASE_P rebasep ' |
ed5144d7 GH |
59 | |
60 | git checkout side-merge && | |
61 | git rebase -p side && | |
62 | git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && | |
63 | git cat-file commit side-merge-original | sed -e "1,/^\$/d" >expect && | |
64 | test_cmp expect actual | |
65 | ||
5e835cac JH |
66 | ' |
67 | ||
68 | test_done |