Skip to content

Commit

Permalink
Use default branch setting instead master
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Dec 5, 2020
1 parent af12f40 commit 71a0543
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/repository/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
if repo.IsEmpty { // Change default branch and empty status only if pushed ref is non-empty branch.
repo.DefaultBranch = refName
repo.IsEmpty = false
if refName != "master" {
if repo.DefaultBranch != setting.Repository.DefaultBranch {
if err := gitRepo.SetDefaultBranch(repo.DefaultBranch); err != nil {
if !git.IsErrUnsupportedVersion(err) {
return err
Expand Down

0 comments on commit 71a0543

Please sign in to comment.