Use -c init.defaultBranch=master to pass the desired main branch to git init

Older versions of git don't support the -b option yet. However, no version of
git complains about the -c option, even when the init.defaultBranch config is
not supported.
This commit is contained in:
Stefan Haller 2023-07-01 15:50:50 +02:00
parent f4ada537d2
commit 82b3803164

View file

@ -255,7 +255,7 @@ func (self *Shell) StartBisect(good string, bad string) *Shell {
}
func (self *Shell) Init() *Shell {
self.RunCommand([]string{"git", "init", "-b", "master"})
self.RunCommand([]string{"git", "-c", "init.defaultBranch=master", "init"})
return self
}