mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Check for 'main' as potential default branch name (#14193)
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user