fix: remove fallbacks for the Get-MainBranch check

This commit is contained in:
Bjarke Sporring
2026-01-21 11:40:00 +01:00
parent c69b463f84
commit 690b83cead

View File

@@ -37,13 +37,7 @@ function Get-MainBranch {
} elseif ($allBranches -contains "master") {
$mainBranch = "master"
} else {
# Get the default branch from git config
$mainBranch = git config --get init.defaultBranch
if (-not $mainBranch) {
# Ultimate fallback: use the first branch
$mainBranch = $allBranches | Select-Object -First 1
if (-not $mainBranch) { $mainBranch = "main" }
}
}
return $mainBranch