Re: [PATCH v2] submodules: fix of regression on fetching of non-init subsub-repo
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 7, 2020, 21:10 UTC
- Message-ID
- <xmqqo8j58gpq.fsf@gitster.c.googlers.com>
- In-Reply-To
- <xmqqsg8h8h3d.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 20 quoted lines
> Philippe Blain <levraiphilippeblain@gmail.com> writes: > >>>> +test_expect_success 'fetching a superproject containing an uninitialized sub/sub project' ' >>>> + # depends on previous test for setup >>>> + >>>> + git -C B/ fetch && >>>> + compare_refs_in_dir A origin/master B origin/master >>> >>> Can we do this without relying on the name of the default branch? >>> Perhaps when outer, middle and inner are prepared, they can be >>> forced to be on the 'sample' (not 'master' nor 'main') branch, or >>> something like that? >> >> Or, simpler, we could call "git remote set-head -a' >> in A and B in the setup script, which would make >> origin/HEAD in A and B point to the default branch, >> such that the call here could be : > > The set-up prepares A and B by cloning from elsewhere, no? Should > we even need a set-head call?
Ah, they are created by cloning an empty repository. That explains why. Thanks.
Show 6 quoted lines
>> compare_refs_in_dir A origin/HEAD B origin/HEAD > > Yes, using HEAD would be another simple way to avoid having to rely > on the default behaviour. > > THanks.