combine-diff: coalesce lost lines optimally
[gitweb.git] / t / t3401-rebase-partial.sh
index 7ba17974c585d005fb4f1c757b76377f0c0518a5..58f482378392c8c358a3129094885f90ead9808c 100755 (executable)
@@ -42,4 +42,28 @@ test_expect_success 'rebase --merge topic branch that was partially merged upstr
        test_path_is_missing .git/rebase-merge
 '
 
+test_expect_success 'rebase ignores empty commit' '
+       git reset --hard A &&
+       git commit --allow-empty -m empty &&
+       test_commit D &&
+       git rebase C &&
+       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