Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B6A5C54EE9 for ; Thu, 8 Sep 2022 19:23:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230425AbiIHTXj (ORCPT ); Thu, 8 Sep 2022 15:23:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231360AbiIHTXc (ORCPT ); Thu, 8 Sep 2022 15:23:32 -0400 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90DE025FF for ; Thu, 8 Sep 2022 12:23:31 -0700 (PDT) Received: (qmail 28587 invoked by uid 109); 8 Sep 2022 19:23:31 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 08 Sep 2022 19:23:31 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 23801 invoked by uid 111); 8 Sep 2022 19:23:31 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 08 Sep 2022 15:23:31 -0400 Authentication-Results: peff.net; auth=none Date: Thu, 8 Sep 2022 15:23:29 -0400 From: Jeff King To: Lana Deere Cc: Johannes Schindelin , =?utf-8?B?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , git@vger.kernel.org Subject: [PATCH 0/2] v2 protocol can't "git pull" with restricted refspec Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Sep 08, 2022 at 02:14:07PM -0400, Jeff King wrote: > 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