diff options
author | Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> | 2012-08-09 08:39:51 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-08-09 10:10:45 -0700 |
commit | 25428403448602a19116dc271f000a3735c6779b (patch) | |
tree | 8f7c68259557d723b0d3094c1fbcc0d972f436c2 /t | |
parent | 2b5ba7b04631a457165531405710e8a303757b01 (diff) | |
download | git-25428403448602a19116dc271f000a3735c6779b.tar.gz git-25428403448602a19116dc271f000a3735c6779b.tar.xz |
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>
Diffstat (limited to 't')
-rwxr-xr-x | t/t3401-rebase-partial.sh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh index 7f8693b92..58f482378 100755 --- a/t/t3401-rebase-partial.sh +++ b/t/t3401-rebase-partial.sh @@ -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 |