Skip to content

Commit

Permalink
Merge pull request #905 from cdonnellytx/fix/explicitInitialBranch
Browse files Browse the repository at this point in the history
Fix tests: Modifying git init initial branch to always be master.
  • Loading branch information
dahlbyk authored Jul 13, 2022
2 parents 858d0e1 + 1fa23a3 commit b8c1f17
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/Shared.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ function NewGitTempRepo([switch]$MakeInitialCommit) {
Push-Location
$temp = [System.IO.Path]::GetTempPath()
$repoPath = Join-Path $temp ([IO.Path]::GetRandomFileName())
&$gitbin init $repoPath *>$null
$initArgs = @()
if (&$gitbin config init.defaultBranch) {
$initArgs += '--initial-branch', 'master'
}

&$gitbin init $initArgs $repoPath *>$null
Set-Location $repoPath

if ($MakeInitialCommit) {
Expand Down

0 comments on commit b8c1f17

Please sign in to comment.