"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Thomas Adam <thomas@xteddy.org>
Subject:
got regress: set inital branch to 'master'
To:
gameoftrees@openbsd.org
Date:
Wed, 29 Sep 2021 19:22:13 +0100

Download raw body.

Thread
Hi,

In newer versions of git (2.28.0, released in July 2020), the tooling gained
support for initialising a default branch name other than 'master'.  By default,
this branch name is now called 'main'.

However, there will be quite a few installations out there where the version
of git has not been updated to this version.  The cmdline/ regress tests
assume 'master' as the default branch name still for expected test output.

Until such time that there is more confidence that we can change this to
'main' in the expected test output, it's possible to tell git to create a
specific default branch name at init time, with:

	git -c init.defaultbranch=master init .

Older versions of git which do not understnad this option will still default
to 'master', and will seemingly ignore the option, hence:

	git -c inittypo.defaultbranch=master init .

Works, and gives me a branch called 'main', which I would expect.

Here's the diff:

diff fa161f0bf4d34a678ba30bf62f5e8eec44ceb931 /home/n6tadam/projects/got/got-patches
blob - 260f6406dd2eba1355d668e2c054b7f09f9f1ee5
file + regress/cmdline/common.sh
--- regress/cmdline/common.sh
+++ regress/cmdline/common.sh
@@ -28,7 +28,7 @@ export MALLOC_OPTIONS=S
 
 git_init()
 {
-	git init -q "$1"
+	git -c init.defaultbranch=master init -q "$1"
 }
 
 maybe_pack_repo()

OK?

Kindly,
Thomas