aboutsummaryrefslogtreecommitdiffstats
path: root/routers/private
diff options
context:
space:
mode:
authorChester Liu <skyline75489@outlook.com>2020-12-30 23:46:26 +0800
committerGitHub <noreply@github.com>2020-12-30 15:46:26 +0000
commit632800eda7108e5e8d90dd9e3e985da3deecf365 (patch)
treeba1c53f6efe0ec373ea311fec8895a278b2f4bcd /routers/private
parentc074e462926f939db1b63b6a40df98da3fb33b6b (diff)
downloadgitea-632800eda7108e5e8d90dd9e3e985da3deecf365.tar.gz
gitea-632800eda7108e5e8d90dd9e3e985da3deecf365.zip
Check for 'main' as potential default branch name (#14193)
Diffstat (limited to 'routers/private')
-rw-r--r--routers/private/hook.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/private/hook.go b/routers/private/hook.go
index 1b9ab000e4..34e849f6f7 100644
--- a/routers/private/hook.go
+++ b/routers/private/hook.go
@@ -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
}