summaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorJohn Olheiser <42128690+jolheiser@users.noreply.github.com>2020-01-04 20:39:14 -0600
committertechknowlogick <techknowlogick@gitea.io>2020-01-04 21:39:14 -0500
commit08424648ae0e7db107d0a1d8b4454557cb9f275f (patch)
tree6c4a71007fb596d4df841ee08a19466c3d1f5a33 /routers/repo
parent03d59bcd1dc775b6b8e52136dff1ba508838db2d (diff)
downloadgitea-08424648ae0e7db107d0a1d8b4454557cb9f275f.tar.gz
gitea-08424648ae0e7db107d0a1d8b4454557cb9f275f.zip
Fix create bugs (#9606)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/repo.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index d44812729f..d6d91f0843 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -180,6 +180,7 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
return
}
+ var repo *models.Repository
var err error
if form.RepoTemplate > 0 {
opts := models.GenerateRepoOptions{
@@ -209,14 +210,14 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
return
}
- repo, err := repo_service.GenerateRepository(ctx.User, ctxUser, templateRepo, opts)
+ repo, err = repo_service.GenerateRepository(ctx.User, ctxUser, templateRepo, opts)
if err == nil {
log.Trace("Repository generated [%d]: %s/%s", repo.ID, ctxUser.Name, repo.Name)
ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + repo.Name)
return
}
} else {
- repo, err := repo_service.CreateRepository(ctx.User, ctxUser, models.CreateRepoOptions{
+ repo, err = repo_service.CreateRepository(ctx.User, ctxUser, models.CreateRepoOptions{
Name: form.RepoName,
Description: form.Description,
Gitignores: form.Gitignores,