]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3416-rebase-onto-threedots.sh
Merge branch 'sg/t-helper-gitignore'
[thirdparty/git.git] / t / t3416-rebase-onto-threedots.sh
index ddf2f648538319df0319c6826f1a64321b3afdb2..9c2548423bcef02e060d0c7047e920f3e6f2485a 100755 (executable)
@@ -99,7 +99,64 @@ test_expect_success 'rebase -i --onto master...side' '
        git checkout side &&
        git reset --hard K &&
 
+       set_fake_editor &&
        test_must_fail git rebase -i --onto master...side J
 '
 
+test_expect_success 'rebase --keep-base --onto incompatible' '
+       test_must_fail git rebase --keep-base --onto master...
+'
+
+test_expect_success 'rebase --keep-base --root incompatible' '
+       test_must_fail git rebase --keep-base --root
+'
+
+test_expect_success 'rebase --keep-base master from topic' '
+       git reset --hard &&
+       git checkout topic &&
+       git reset --hard G &&
+
+       git rebase --keep-base master &&
+       git rev-parse C >base.expect &&
+       git merge-base master HEAD >base.actual &&
+       test_cmp base.expect base.actual &&
+
+       git rev-parse HEAD~2 >actual &&
+       git rev-parse C^0 >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success 'rebase --keep-base master from side' '
+       git reset --hard &&
+       git checkout side &&
+       git reset --hard K &&
+
+       test_must_fail git rebase --keep-base master
+'
+
+test_expect_success 'rebase -i --keep-base master from topic' '
+       git reset --hard &&
+       git checkout topic &&
+       git reset --hard G &&
+
+       set_fake_editor &&
+       EXPECT_COUNT=2 git rebase -i --keep-base master &&
+       git rev-parse C >base.expect &&
+       git merge-base master HEAD >base.actual &&
+       test_cmp base.expect base.actual &&
+
+       git rev-parse HEAD~2 >actual &&
+       git rev-parse C^0 >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success 'rebase -i --keep-base master from side' '
+       git reset --hard &&
+       git checkout side &&
+       git reset --hard K &&
+
+       set_fake_editor &&
+       test_must_fail git rebase -i --keep-base master
+'
+
 test_done