[PATCH v4 5/8] t5520: test --rebase with multiple branches
- From
Paul Tan <pyokagan@gmail.com>
- Date
- May 18, 2015, 13:32 UTC
- Message-ID
- <1431955978-17890-6-git-send-email-pyokagan@gmail.com>
- In-Reply-To
- <1431955978-17890-1-git-send-email-pyokagan@gmail.com>
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> --- * Removed use of "verbose".
t/t5520-pull.sh | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 3a53a5e..f991439 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -218,6 +218,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 &&
-- 2.1.4