Skip to content

Commit ab74b03

Browse files
committed
Use init.defaultBranch instead of --initial-branch option
My local Git version does not yet know the `--initial-branch` and thus the `FileGitAlgTest` fails with: ``` org.scalasteward.core.git.FileGitAlgTest: ==> X org.scalasteward.core.git.FileGitAlgTest.branchAuthors 0.585s java.io.IOException: 'VAR1=val1 VAR2=val2 git init . --initial-branch master' exited with code 129 error: unknown option `initial-branch' ``` Instead of using this option, we call `git init` now with the `init.defaultBranch=master` config which should have the same effect as the `--initial-branch` option according to the [docs](https://git-scm.com/docs/git-init). Older Git versions just ignore this config. I hope this also fixes the problem mentioned in cfe5857
1 parent 7de5efa commit ab74b03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/core/src/test/scala/org/scalasteward/core/git/FileGitAlgTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ object FileGitAlgTest {
205205
for {
206206
_ <- gitAlg.removeClone(repo)
207207
_ <- fileAlg.ensureExists(repo)
208-
_ <- git("init", ".", "--initial-branch", "master")(repo)
208+
_ <- git("-c", "init.defaultBranch=master", "init", ".")(repo)
209209
_ <- gitAlg.setAuthor(repo, config.gitCfg.gitAuthor)
210210
_ <- git("commit", "--allow-empty", "-m", "Initial commit")(repo)
211211
} yield ()

0 commit comments

Comments
 (0)