Re: [PATCH v2 10/12] t5520: failing test for pull --all with no configured upstream
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 7, 2015, 17:38 UTC
- Message-ID
- <xmqq3838qoeb.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1430988248-18285-11-git-send-email-pyokagan@gmail.com>
Paul Tan <pyokagan@gmail.com> writes:
Show 7 quoted lines
> error_on_no_merge_candidates() does not consider the case where "$#" > includes command-line flags that are passed to git-fetch. > > As such, when the current branch has no configured upstream, and there > are no merge candidates because of that, git-pull --all erroneously reports > that we are pulling from "--all", as it believes that the first argument > is the remote name.
Interesting.
I do not think "pull [origin] --all" makes much sense for the same reason why we error out when you say "pull [origin] --tag", so I am not sure "There is no tracking information" is the right diag we would want to give the user, but I agree that "--all" is not a remote name.
Does the same comment as 11/12 applies to this as well?
Show 36 quoted lines
> > Add a failing test that shows this case. > > Reported-by: Stephen Robin <stephen.robin@gmail.com> > Signed-off-by: Paul Tan <pyokagan@gmail.com> > --- > > Notes: > * Added this test to the patch series. > > t/t5520-pull.sh | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh > index d97a575..b93b735 100755 > --- a/t/t5520-pull.sh > +++ b/t/t5520-pull.sh > @@ -153,6 +153,18 @@ test_expect_success 'fail if no configuration for current branch' ' > test `cat file` = file > ' > > +test_expect_failure 'pull --all: fail if no configuration for current branch' ' > + git remote add test_remote . && > + test_when_finished "git remote remove test_remote" && > + git checkout -b test copy^ && > + test_when_finished "git checkout -f copy && git branch -D test" && > + test_config branch.test.remote test_remote && > + test `cat file` = file && > + test_must_fail git pull --all 2>out && > + test_i18ngrep "There is no tracking information" out && > + test `cat file` = file > +' > + > test_expect_success 'fail if upstream branch does not exist' ' > git checkout -b test copy^ && > test_when_finished "git checkout -f copy && git branch -D test" &&