Skip to content

Commit

Permalink
RepoInit Respect AlternateDefaultBranch (#12746) (#12751)
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored Sep 6, 2020
1 parent 0bb56a4 commit dc71d00
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/repository/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *m
}
}

if len(opts.DefaultBranch) == 0 {
opts.DefaultBranch = setting.Repository.DefaultBranch
}

repo := &models.Repository{
OwnerID: u.ID,
Owner: u,
Expand Down

0 comments on commit dc71d00

Please sign in to comment.