From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53F17C433B4 for ; Fri, 30 Apr 2021 16:07:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09C0161420 for ; Fri, 30 Apr 2021 16:07:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbhD3QIk convert rfc822-to-8bit (ORCPT ); Fri, 30 Apr 2021 12:08:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbhD3QIj (ORCPT ); Fri, 30 Apr 2021 12:08:39 -0400 Received: from mav.lukeshu.com (mav.lukeshu.com [IPv6:2001:19f0:5c00:8069:5400:ff:fe26:6a86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B9E4C06174A for ; Fri, 30 Apr 2021 09:07:51 -0700 (PDT) Received: from lukeshu-dw-thinkpad (unknown [IPv6:2601:281:8200:26:4e34:88ff:fe48:5521]) by mav.lukeshu.com (Postfix) with ESMTPSA id E5ABD80590; Fri, 30 Apr 2021 12:07:44 -0400 (EDT) Date: Fri, 30 Apr 2021 10:07:43 -0600 Message-ID: <87mttfpxgw.wl-lukeshu@lukeshu.com> From: Luke Shumaker To: =?ISO-8859-1?Q?=C6var_Arnfj=F6r=F0?= Bjarmason Cc: Luke Shumaker , git@vger.kernel.org, Avery Pennarun , Charles Bailey , Danny Lin , "David A .\ Greene" , David Aguilar , James Denholm , Jeff King , Jonathan Nieder , Junio C Hamano , =?UTF-8?B?Tmd1eeG7hW4g?= =?ISO-8859-1?Q?Th=E1i_?= =?UTF-8?B?Tmfhu41j?= Duy , Roger L Strain , Techlive Zheng , Eric Sunshine , Luke Shumaker Subject: Re: [PATCH v3 02/30] subtree: t7900: update for having the default branch name be 'main' In-Reply-To: <87zgxgxg3t.fsf@evledraar.gmail.com> References: <20210426174525.3937858-1-lukeshu@lukeshu.com> <20210427211748.2607474-1-lukeshu@lukeshu.com> <20210427211748.2607474-3-lukeshu@lukeshu.com> <87zgxgxg3t.fsf@evledraar.gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, 30 Apr 2021 03:38:52 -0600, Ævar Arnfjörð Bjarmason wrote: > > @@ -994,6 +994,7 @@ test_expect_success 'push split to subproj' ' > > next_test > > test_expect_success 'subtree descendant check' ' > > subtree_test_create_repo "$subtree_test_count" && > > + defaultBranch=$(sed "s,ref: refs/heads/,," "$subtree_test_count/.git/HEAD") && > > test_create_commit "$subtree_test_count" folder_subtree/a && > > ( > > cd "$subtree_test_count" && > > This though needlessly peeks into the raw refstore. Use branch=$(git > symbolic-ref --short HEAD) instead. See e.g. my > https://lore.kernel.org/git/patch-08.11-7fb8849ce66-20210423T072006Z-avarab@gmail.com/ I was about to say that doesn't work with a freshly initialized repo without a commit yet, but I'm thinking of `git rev-parse --abbrev-ref HEAD`. I'll change it if I have to re-roll for another reason. -- Happy hacking, ~ Luke Shumaker