mirror of
https://github.com/git/git.git
synced 2024-11-24 10:26:17 +08:00
add tests for 'git rebase --keep-empty'
Add test cases for 'git rebase --keep-empty' with and without an "empty" commit already in upstream. The empty commit that is about to be rebased should be kept in both cases. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
2b5ba7b046
commit
2542840344
@ -47,7 +47,23 @@ test_expect_success 'rebase ignores empty commit' '
|
||||
git commit --allow-empty -m empty &&
|
||||
test_commit D &&
|
||||
git rebase C &&
|
||||
test $(git log --format=%s C..) = "D"
|
||||
test "$(git log --format=%s C..)" = "D"
|
||||
'
|
||||
|
||||
test_expect_success 'rebase --keep-empty' '
|
||||
git reset --hard D &&
|
||||
git rebase --keep-empty C &&
|
||||
test "$(git log --format=%s C..)" = "D
|
||||
empty"
|
||||
'
|
||||
|
||||
test_expect_success 'rebase --keep-empty keeps empty even if already in upstream' '
|
||||
git reset --hard A &&
|
||||
git commit --allow-empty -m also-empty &&
|
||||
git rebase --keep-empty D &&
|
||||
test "$(git log --format=%s A..)" = "also-empty
|
||||
D
|
||||
empty"
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user