Skip to content

Commit b8c1f17

Browse files
authored
Merge pull request #905 from cdonnellytx/fix/explicitInitialBranch
Fix tests: Modifying git init initial branch to always be master.
2 parents 858d0e1 + 1fa23a3 commit b8c1f17

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/Shared.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ function NewGitTempRepo([switch]$MakeInitialCommit) {
126126
Push-Location
127127
$temp = [System.IO.Path]::GetTempPath()
128128
$repoPath = Join-Path $temp ([IO.Path]::GetRandomFileName())
129-
&$gitbin init $repoPath *>$null
129+
$initArgs = @()
130+
if (&$gitbin config init.defaultBranch) {
131+
$initArgs += '--initial-branch', 'master'
132+
}
133+
134+
&$gitbin init $initArgs $repoPath *>$null
130135
Set-Location $repoPath
131136

132137
if ($MakeInitialCommit) {

0 commit comments

Comments
 (0)