From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 9EDC11F54E for ; Thu, 8 Sep 2022 19:23:41 +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