Junio C Hamano | 5e835ca | 2008-04-16 12:50:48 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='rebasing a commit with multi-line first paragraph.' |
| 4 | |
Johannes Schindelin | d1c02d9 | 2020-11-18 23:44:25 +0000 | [diff] [blame] | 5 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
Johannes Schindelin | 334afbc | 2020-11-18 23:44:19 +0000 | [diff] [blame] | 6 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
| 7 | |
Ævar Arnfjörð Bjarmason | 7a98d9a | 2022-04-13 22:01:47 +0200 | [diff] [blame] | 8 | TEST_PASSES_SANITIZE_LEAK=true |
Junio C Hamano | 5e835ca | 2008-04-16 12:50:48 -0700 | [diff] [blame] | 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 | |
Jonathan Nieder | a48fcd8 | 2010-10-30 20:46:54 -0500 | [diff] [blame] | 23 | But otherwise with a sane description." && |
Junio C Hamano | 5e835ca | 2008-04-16 12:50:48 -0700 | [diff] [blame] | 24 | |
| 25 | git branch side && |
| 26 | |
| 27 | git reset --hard HEAD^ && |
| 28 | >elif && |
| 29 | git add elif && |
| 30 | test_tick && |
Gregory Herrero | ed5144d | 2018-02-08 21:42:41 +0100 | [diff] [blame] | 31 | git commit -m second && |
Junio C Hamano | 5e835ca | 2008-04-16 12:50:48 -0700 | [diff] [blame] | 32 | |
Gregory Herrero | ed5144d | 2018-02-08 21:42:41 +0100 | [diff] [blame] | 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 |
Junio C Hamano | 5e835ca | 2008-04-16 12:50:48 -0700 | [diff] [blame] | 48 | ' |
| 49 | |
| 50 | test_expect_success rebase ' |
| 51 | |
| 52 | git checkout side && |
Johannes Schindelin | d1c02d9 | 2020-11-18 23:44:25 +0000 | [diff] [blame] | 53 | git rebase main && |
Stephen Boyd | 9524cf2 | 2010-01-26 15:08:31 -0800 | [diff] [blame] | 54 | git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && |
| 55 | git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect && |
Junio C Hamano | 5e835ca | 2008-04-16 12:50:48 -0700 | [diff] [blame] | 56 | test_cmp expect actual |
| 57 | |
| 58 | ' |
Junio C Hamano | 5e835ca | 2008-04-16 12:50:48 -0700 | [diff] [blame] | 59 | test_done |