Junio C Hamano <gitster@xxxxxxxxx> writes: > Philippe Blain <levraiphilippeblain@xxxxxxxxx> 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. >> 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.