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:02 UTC
- Message-ID
- <xmqqsg8h8h3d.fsf@gitster.c.googlers.com>
- In-Reply-To
- <BF6B37E9-5AF9-4A81-90D8-0270D1269332@gmail.com>
Philippe Blain <levraiphilippeblain@gmail.com> writes:
Show 15 quoted lines
>>> +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?
> 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.