forked from toolshed/abra
fix: branch checking logic
See https://github.com/go-git/go-git/issues/518 for why this is needed.
This commit is contained in:
@ -625,8 +625,8 @@ func GetDefaultBranch(repo *git.Repository, recipeName string) (plumbing.Referen
|
||||
}
|
||||
|
||||
branch := "master"
|
||||
if _, err := repo.Branch("master"); err != nil {
|
||||
if _, err := repo.Branch("main"); err != nil {
|
||||
if !gitPkg.HasBranch(repo, "master") {
|
||||
if !gitPkg.HasBranch(repo, "main") {
|
||||
return "", fmt.Errorf("failed to select default branch in %s", recipeDir)
|
||||
}
|
||||
branch = "main"
|
||||
|
Reference in New Issue
Block a user