Skip to content

Commit 570f293

Browse files
committed
Merge branch 'mz/empty-rebase-test'
* mz/empty-rebase-test: add tests for 'git rebase --keep-empty'
2 parents 72c4dbe + 2542840 commit 570f293

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

t/t3401-rebase-partial.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,23 @@ test_expect_success 'rebase ignores empty commit' '
4747
git commit --allow-empty -m empty &&
4848
test_commit D &&
4949
git rebase C &&
50-
test $(git log --format=%s C..) = "D"
50+
test "$(git log --format=%s C..)" = "D"
51+
'
52+
53+
test_expect_success 'rebase --keep-empty' '
54+
git reset --hard D &&
55+
git rebase --keep-empty C &&
56+
test "$(git log --format=%s C..)" = "D
57+
empty"
58+
'
59+
60+
test_expect_success 'rebase --keep-empty keeps empty even if already in upstream' '
61+
git reset --hard A &&
62+
git commit --allow-empty -m also-empty &&
63+
git rebase --keep-empty D &&
64+
test "$(git log --format=%s A..)" = "also-empty
65+
D
66+
empty"
5167
'
5268

5369
test_done

0 commit comments

Comments
 (0)