Skip to content

Commit 9570d67

Browse files
pyokagangitster
authored andcommitted
t5520: test --rebase with multiple branches
Since rebasing on top of multiple upstream branches does not make sense, since 51b2ead (disallow providing multiple upstream branches to rebase, pull --rebase, 2009-02-18), git-pull explicitly disallowed specifying multiple branches in the rebase case. Implement tests to ensure that git-pull fails and prints out the user-friendly error message in such a case. Signed-off-by: Paul Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9f99226 commit 9570d67

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

t/t5520-pull.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,15 @@ test_expect_success '--rebase' '
217217
test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
218218
test new = "$(git show HEAD:file2)"
219219
'
220+
221+
test_expect_success '--rebase fails with multiple branches' '
222+
git reset --hard before-rebase &&
223+
test_must_fail git pull --rebase . copy master 2>err &&
224+
test "$(git rev-parse HEAD)" = "$(git rev-parse before-rebase)" &&
225+
test_i18ngrep "Cannot rebase onto multiple branches" err &&
226+
test modified = "$(git show HEAD:file)"
227+
'
228+
220229
test_expect_success 'pull.rebase' '
221230
git reset --hard before-rebase &&
222231
test_config pull.rebase true &&

0 commit comments

Comments
 (0)