mirror of
https://gitee.com/gitea/gitea.git
synced 2024-12-02 11:47:49 +08:00
Make repo creation for API similar to UI (#6142)
This commit is contained in:
parent
3b61ff1895
commit
df30010dbd
@ -213,6 +213,9 @@ func Search(ctx *context.APIContext) {
|
||||
|
||||
// CreateUserRepo create a repository for a user
|
||||
func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateRepoOption) {
|
||||
if opt.AutoInit && opt.Readme == "" {
|
||||
opt.Readme = "Default"
|
||||
}
|
||||
repo, err := models.CreateRepository(ctx.User, owner, models.CreateRepoOptions{
|
||||
Name: opt.Name,
|
||||
Description: opt.Description,
|
||||
|
Loading…
Reference in New Issue
Block a user