fix: remove fallbacks for the Get-MainBranch check
This commit is contained in:
6
util.ps1
6
util.ps1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user