On Fri Nov 15, 2024 at 05:52, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Bence Ferdinandy <bence@xxxxxxxxxxxxxx> writes: > >> Consider the bare repository called "mirror" in the test. Running `git >> remote add --mirror -f origin ../one` will not change HEAD, consequently >> if init.defaultBranch is not the same as what HEAD in the remote >> ("one"), HEAD in "mirror" will be pointing to a non-existent reference. >> Hence if "mirror" is used as a remote by yet another repository, >> ls-remote will not show HEAD. On the other hand, if init.defaultBranch >> happens to match HEAD in "one", then ls-remote will show HEAD. > > Making sure that the hardcoded (in the Git binary) default branch > name would not affect the outcome of the test is a good thing to do. > I like the patch text, but ... > >> Since the CI globally exports GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main, >> there's a drift between how the test repositories are set up in the CI >> and during local testing. This issue does not manifest currently, as the >> test does not do any remote HEAD manipulation where this would come up, >> but should such things be added, a locally passing test would break the >> CI vice-versa. > > ... this description may not quite be accurate. Don't some jobs of > CI use 'main' while the rest use 'master'? True, it's that one specific job, and of course "there may be a drift depending on the particular test" is more accurate. I'll update for a v13.