aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
author赵智超 <1012112796@qq.com>2020-09-25 13:18:37 +0800
committerGitHub <noreply@github.com>2020-09-25 13:18:37 +0800
commit3c360801b3547cba80766403c0ee2835cb81272d (patch)
treeede959cb670140686ac8fcd7000f06fd50bac382 /routers
parent7a7f56044ae0b94d9f5e733d863821dbe222a395 (diff)
downloadgitea-3c360801b3547cba80766403c0ee2835cb81272d.tar.gz
gitea-3c360801b3547cba80766403c0ee2835cb81272d.zip
Add IsTemplate option in create repo ui and api (#12942)
Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/repo.go1
-rw-r--r--routers/repo/repo.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index b8a24e2532..116e413125 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -245,6 +245,7 @@ func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateR
AutoInit: opt.AutoInit,
DefaultBranch: opt.DefaultBranch,
TrustModel: models.ToTrustModel(opt.TrustModel),
+ IsTemplate: opt.Template,
})
if err != nil {
if models.IsErrRepoAlreadyExist(err) {
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 12434747eb..883d30a5d9 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -250,6 +250,7 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
IsPrivate: form.Private || setting.Repository.ForcePrivate,
DefaultBranch: form.DefaultBranch,
AutoInit: form.AutoInit,
+ IsTemplate: form.Template,
TrustModel: models.ToTrustModel(form.TrustModel),
})
if err == nil {