Re: [PATCH v3 02/30] subtree: t7900: update for having the default branch name be 'main'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/

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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux