[PATCH 0/2] v2 protocol can't "git pull" with restricted refspec
- From
Jeff King <peff@peff.net>
- Date
- Sep 8, 2022, 19:23 UTC
- Message-ID
- <YxpBMaIckimFJYEi@coredump.intra.peff.net>
- In-Reply-To
- <Yxow7zrYF/xOijVr@coredump.intra.peff.net>
On Thu, Sep 08, 2022 at 02:14:07PM -0400, Jeff King wrote:
Show 7 quoted lines
> This is a bug which we should fix. But in the meantime the obvious > workaround is to expand the default refspec to cover both branches. > Obviously the default of fetching "refs/heads/*" would work, but if you > want to keep it limited for some reason, you can add the second branch > explicitly. In the example above, it would be: > > git config --add remote.origin.fetch +refs/heads/branch2:refs/remotes/origin/branch2
And here's the patch to fix it. There was a small cleanup needed, hence the 2-patch series.
[1/2]: fetch: stop checking for NULL transport->remote in do_fetch() [2/2]: fetch: add branch.*.merge to default ref-prefix extension
builtin/fetch.c | 18 +++++++++++++++--- t/t5520-pull.sh | 17 +++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-)
-Peff