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 <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Paul Tan committed May 29, 2015 at 19:44 UTC 9570d67c00d6f2994e540aab3abee8f989c350ea
1 file changed +9
t/t5520-pull.sh
+9
@@ -217,6 +217,15 @@ test_expect_success '--rebase' '
217 test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
218 test new = "$(git show HEAD:file2)"
219 '
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 +
229 test_expect_success 'pull.rebase' '
230 git reset --hard before-rebase &&
231 test_config pull.rebase true &&