Accept more main branch names for login detection #396
|
@ -166,10 +166,14 @@ func contextFromLocalRepo(repoPath, remoteValue string) (*git.TeaRepo, *config.L
|
||||||
}
|
}
|
||||||
if len(gitConfig.Remotes) > 1 {
|
if len(gitConfig.Remotes) > 1 {
|
||||||
// if master branch is present, use it as the default remote
|
// if master branch is present, use it as the default remote
|
||||||
masterBranch, ok := gitConfig.Branches["master"]
|
mainBranches := []string{"main", "master", "trunk"}
|
||||||
if ok {
|
for _, b := range mainBranches {
|
||||||
if len(masterBranch.Remote) > 0 {
|
masterBranch, ok := gitConfig.Branches[b]
|
||||||
remoteValue = masterBranch.Remote
|
if ok {
|
||||||
|
if len(masterBranch.Remote) > 0 {
|
||||||
|
remoteValue = masterBranch.Remote
|
||||||
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user