mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Option to set default branch at repository creation (#10803)
* Option to set default branch at repository creation * Handle template repos with non-default master branch * Add DefaultBranch handling on creation to API Fix #9542 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
@@ -221,14 +221,15 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
|
||||
}
|
||||
} else {
|
||||
repo, err = repo_service.CreateRepository(ctx.User, ctxUser, models.CreateRepoOptions{
|
||||
Name: form.RepoName,
|
||||
Description: form.Description,
|
||||
Gitignores: form.Gitignores,
|
||||
IssueLabels: form.IssueLabels,
|
||||
License: form.License,
|
||||
Readme: form.Readme,
|
||||
IsPrivate: form.Private || setting.Repository.ForcePrivate,
|
||||
AutoInit: form.AutoInit,
|
||||
Name: form.RepoName,
|
||||
Description: form.Description,
|
||||
Gitignores: form.Gitignores,
|
||||
IssueLabels: form.IssueLabels,
|
||||
License: form.License,
|
||||
Readme: form.Readme,
|
||||
IsPrivate: form.Private || setting.Repository.ForcePrivate,
|
||||
DefaultBranch: form.DefaultBranch,
|
||||
AutoInit: form.AutoInit,
|
||||
})
|
||||
if err == nil {
|
||||
log.Trace("Repository created [%d]: %s/%s", repo.ID, ctxUser.Name, repo.Name)
|
||||
|
Reference in New Issue
Block a user