aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/migrate.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/migrate.go')
-rw-r--r--routers/repo/migrate.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/routers/repo/migrate.go b/routers/repo/migrate.go
index a628fd2e2f..89452de0fa 100644
--- a/routers/repo/migrate.go
+++ b/routers/repo/migrate.go
@@ -10,14 +10,15 @@ import (
"strings"
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/modules/auth"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
+ auth "code.gitea.io/gitea/modules/forms"
"code.gitea.io/gitea/modules/migrations"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/task"
"code.gitea.io/gitea/modules/util"
+ "code.gitea.io/gitea/modules/web"
)
const (
@@ -117,7 +118,8 @@ func handleMigrateError(ctx *context.Context, owner *models.User, err error, nam
}
// MigratePost response for migrating from external git repository
-func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) {
+func MigratePost(ctx *context.Context) {
+ form := web.GetForm(ctx).(*auth.MigrateRepoForm)
if setting.Repository.DisableMigrations {
ctx.Error(http.StatusForbidden, "MigratePost: the site administrator has disabled migrations")
return
@@ -192,7 +194,7 @@ func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) {
err = models.CheckCreateRepository(ctx.User, ctxUser, opts.RepoName, false)
if err != nil {
- handleMigrateError(ctx, ctxUser, err, "MigratePost", tpl, &form)
+ handleMigrateError(ctx, ctxUser, err, "MigratePost", tpl, form)
return
}
@@ -202,5 +204,5 @@ func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) {
return
}
- handleMigrateError(ctx, ctxUser, err, "MigratePost", tpl, &form)
+ handleMigrateError(ctx, ctxUser, err, "MigratePost", tpl, form)
}