Skip to content

Commit

Permalink
t5520: test --rebase with multiple branches
Browse files Browse the repository at this point in the history
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 <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Paul Tan authored and Junio C Hamano committed May 29, 2015
1 parent 9f99226 commit 9570d67
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions t/t5520-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,15 @@ test_expect_success '--rebase' '
test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
test new = "$(git show HEAD:file2)"
'

test_expect_success '--rebase fails with multiple branches' '
git reset --hard before-rebase &&
test_must_fail git pull --rebase . copy master 2>err &&
test "$(git rev-parse HEAD)" = "$(git rev-parse before-rebase)" &&
test_i18ngrep "Cannot rebase onto multiple branches" err &&
test modified = "$(git show HEAD:file)"
'

test_expect_success 'pull.rebase' '
git reset --hard before-rebase &&
test_config pull.rebase true &&
Expand Down

0 comments on commit 9570d67

Please sign in to comment.