t3416: tighten two tests

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>

Phillip Wood committed Oct 17, 2022 at 13:17 UTC 96601a26b4cdb2184b79b63aa670f695f5690183
1 file changed +6 -4
t/t3416-rebase-onto-threedots.sh
+6 -4
@@ -97,13 +97,14 @@ test_expect_success 'rebase -i --onto main...' '
97 test_cmp expect actual
98 '
99
100 -test_expect_success 'rebase -i --onto main...side' '
100 +test_expect_success 'rebase --onto main...side requires a single merge-base' '
101 git reset --hard &&
102 git checkout side &&
103 git reset --hard K &&
104
105 set_fake_editor &&
106 - test_must_fail git rebase -i --onto main...side J
106 + test_must_fail git rebase -i --onto main...side J 2>err &&
107 + grep "need exactly one merge base" err
108 '
109
110 test_expect_success 'rebase --keep-base --onto incompatible' '
@@ -182,13 +183,14 @@ test_expect_success 'rebase -i --keep-base main topic from main' '
183 test_cmp expect actual
184 '
185
185 -test_expect_success 'rebase -i --keep-base main from side' '
186 +test_expect_success 'rebase --keep-base requires a single merge base' '
187 git reset --hard &&
188 git checkout side &&
189 git reset --hard K &&
190
191 set_fake_editor &&
191 - test_must_fail git rebase -i --keep-base main
192 + test_must_fail git rebase -i --keep-base main 2>err &&
193 + grep "need exactly one merge base with branch" err
194 '
195
196 test_done