]> git.ipfire.org Git - thirdparty/git.git/blob - t/t3408-rebase-multi-line.sh
The second batch
[thirdparty/git.git] / t / t3408-rebase-multi-line.sh
1 #!/bin/sh
2
3 test_description='rebasing a commit with multi-line first paragraph.'
4
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8 TEST_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
10
11 test_expect_success setup '
12
13 >file &&
14 git add file &&
15 test_tick &&
16 git commit -m initial &&
17
18 echo hello >file &&
19 test_tick &&
20 git commit -a -m "A sample commit log message that has a long
21 summary that spills over multiple lines.
22
23 But otherwise with a sane description." &&
24
25 git branch side &&
26
27 git reset --hard HEAD^ &&
28 >elif &&
29 git add elif &&
30 test_tick &&
31 git commit -m second &&
32
33 git checkout -b side2 &&
34 >afile &&
35 git add afile &&
36 test_tick &&
37 git commit -m third &&
38 echo hello >afile &&
39 test_tick &&
40 git commit -a -m fourth &&
41 git checkout -b side-merge &&
42 git reset --hard HEAD^^ &&
43 git merge --no-ff -m "A merge commit log message that has a long
44 summary that spills over multiple lines.
45
46 But otherwise with a sane description." side2 &&
47 git branch side-merge-original
48 '
49
50 test_expect_success rebase '
51
52 git checkout side &&
53 git rebase main &&
54 git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
55 git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect &&
56 test_cmp expect actual
57
58 '
59 test_done