Skip to content

Commit 71a0543

Browse files
committed
Use default branch setting instead master
1 parent af12f40 commit 71a0543

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/repository/push.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
131131
if repo.IsEmpty { // Change default branch and empty status only if pushed ref is non-empty branch.
132132
repo.DefaultBranch = refName
133133
repo.IsEmpty = false
134-
if refName != "master" {
134+
if repo.DefaultBranch != setting.Repository.DefaultBranch {
135135
if err := gitRepo.SetDefaultBranch(repo.DefaultBranch); err != nil {
136136
if !git.IsErrUnsupportedVersion(err) {
137137
return err

0 commit comments

Comments
 (0)