]> git.ipfire.org Git - thirdparty/git.git/blame - t/t3408-rebase-multi-line.sh
Sync with Git 2.45.1
[thirdparty/git.git] / t / t3408-rebase-multi-line.sh
CommitLineData
5e835cac
JH
1#!/bin/sh
2
3test_description='rebasing a commit with multi-line first paragraph.'
4
d1c02d93 5GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
334afbc7
JS
6export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
7a98d9ab 8TEST_PASSES_SANITIZE_LEAK=true
5e835cac
JH
9. ./test-lib.sh
10
11test_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
21summary that spills over multiple lines.
22
a48fcd83 23But otherwise with a sane description." &&
5e835cac
JH
24
25 git branch side &&
26
27 git reset --hard HEAD^ &&
28 >elif &&
29 git add elif &&
30 test_tick &&
ed5144d7 31 git commit -m second &&
5e835cac 32
ed5144d7
GH
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
44summary that spills over multiple lines.
45
46But otherwise with a sane description." side2 &&
47 git branch side-merge-original
5e835cac
JH
48'
49
50test_expect_success rebase '
51
52 git checkout side &&
d1c02d93 53 git rebase main &&
9524cf29
SB
54 git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
55 git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect &&
5e835cac
JH
56 test_cmp expect actual
57
ed5144d7 58'
5e835cac 59test_done