Merge branch 'mz/empty-rebase-test'
authorJunio C Hamano <gitster@pobox.com>
Wed, 29 Aug 2012 21:49:57 +0000 (14:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Aug 2012 21:49:57 +0000 (14:49 -0700)
* mz/empty-rebase-test:
add tests for 'git rebase --keep-empty'

t/t3401-rebase-partial.sh
index 7f8693b928fdb827906f7c51ec0a13b2f36c5b83..58f482378392c8c358a3129094885f90ead9808c 100755 (executable)
@@ -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