Skip to content

Commit 96601a2

Browse files
phillipwoodgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ad60ddd commit 96601a2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

t/t3416-rebase-onto-threedots.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,14 @@ test_expect_success 'rebase -i --onto main...' '
9797
test_cmp expect actual
9898
'
9999

100-
test_expect_success 'rebase -i --onto main...side' '
100+
test_expect_success 'rebase --onto main...side requires a single merge-base' '
101101
git reset --hard &&
102102
git checkout side &&
103103
git reset --hard K &&
104104
105105
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
107108
'
108109

109110
test_expect_success 'rebase --keep-base --onto incompatible' '
@@ -182,13 +183,14 @@ test_expect_success 'rebase -i --keep-base main topic from main' '
182183
test_cmp expect actual
183184
'
184185

185-
test_expect_success 'rebase -i --keep-base main from side' '
186+
test_expect_success 'rebase --keep-base requires a single merge base' '
186187
git reset --hard &&
187188
git checkout side &&
188189
git reset --hard K &&
189190
190191
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
192194
'
193195

194196
test_done

0 commit comments

Comments
 (0)