forked from forgejo/forgejo
Check for 'main' as potential default branch name (#14193)
This commit is contained in:
parent
c074e46292
commit
632800eda7
3 changed files with 11 additions and 2 deletions
|
@ -412,8 +412,8 @@ func HookPostReceive(ctx *macaron.Context, opts private.HookOptions) {
|
|||
RepoName: repoName,
|
||||
}
|
||||
updates = append(updates, &option)
|
||||
if repo.IsEmpty && option.IsBranch() && option.BranchName() == "master" {
|
||||
// put the master branch first
|
||||
if repo.IsEmpty && option.IsBranch() && (option.BranchName() == "master" || option.BranchName() == "main") {
|
||||
// put the master/main branch first
|
||||
copy(updates[1:], updates)
|
||||
updates[0] = &option
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue