]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t3416: tighten two tests
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Mon, 17 Oct 2022 13:17:38 +0000 (13:17 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Oct 2022 18:45:09 +0000 (11:45 -0700)
Add a check for the correct error message to the tests that check we
require a single merge base so we can be sure the rebase failed for
the correct reason. Also rename the tests to reflect what they are
testing.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3416-rebase-onto-threedots.sh

index 3e04802cb003b027c0d70319465af4363877de06..dc67d2308f36a0648d14e2c77de2b109145033d7 100755 (executable)
@@ -97,13 +97,14 @@ test_expect_success 'rebase -i --onto main...' '
        test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --onto main...side' '
+test_expect_success 'rebase --onto main...side requires a single merge-base' '
        git reset --hard &&
        git checkout side &&
        git reset --hard K &&
 
        set_fake_editor &&
-       test_must_fail git rebase -i --onto main...side J
+       test_must_fail git rebase -i --onto main...side J 2>err &&
+       grep "need exactly one merge base" err
 '
 
 test_expect_success 'rebase --keep-base --onto incompatible' '
@@ -182,13 +183,14 @@ test_expect_success 'rebase -i --keep-base main topic from main' '
        test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --keep-base main from side' '
+test_expect_success 'rebase --keep-base requires a single merge base' '
        git reset --hard &&
        git checkout side &&
        git reset --hard K &&
 
        set_fake_editor &&
-       test_must_fail git rebase -i --keep-base main
+       test_must_fail git rebase -i --keep-base main 2>err &&
+       grep "need exactly one merge base with branch" err
 '
 
 test_done