summaryrefslogtreecommitdiffstats
path: root/routers/private/restore_repo.go
diff options
context:
space:
mode:
authorAravinth Manivannan <realaravinth@batsense.net>2022-01-26 09:45:51 +0000
committerGitHub <noreply@github.com>2022-01-26 10:45:51 +0100
commit3bb028cc46401a8a54ecab7e7c035dbb24937b6c (patch)
treebff1aaaaa9d5eef6b9d1c520337e3cc51153b9e2 /routers/private/restore_repo.go
parent49dd9067535538771ef13623ed1dd9698a4a2151 (diff)
downloadgitea-3bb028cc46401a8a54ecab7e7c035dbb24937b6c.tar.gz
gitea-3bb028cc46401a8a54ecab7e7c035dbb24937b6c.zip
Validate migration files (#18203)
JSON Schema validation for data used by Gitea during migrations Discussion at https://forum.forgefriends.org/t/common-json-schema-for-repository-information/563 Co-authored-by: Loïc Dachary <loic@dachary.org>
Diffstat (limited to 'routers/private/restore_repo.go')
-rw-r--r--routers/private/restore_repo.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/routers/private/restore_repo.go b/routers/private/restore_repo.go
index 8dfe569325..34e06e51c2 100644
--- a/routers/private/restore_repo.go
+++ b/routers/private/restore_repo.go
@@ -24,10 +24,11 @@ func RestoreRepo(ctx *myCtx.PrivateContext) {
return
}
params := struct {
- RepoDir string
- OwnerName string
- RepoName string
- Units []string
+ RepoDir string
+ OwnerName string
+ RepoName string
+ Units []string
+ Validation bool
}{}
if err = json.Unmarshal(bs, &params); err != nil {
ctx.JSON(http.StatusInternalServerError, private.Response{
@@ -42,6 +43,7 @@ func RestoreRepo(ctx *myCtx.PrivateContext) {
params.OwnerName,
params.RepoName,
params.Units,
+ params.Validation,
); err != nil {
ctx.JSON(http.StatusInternalServerError, private.Response{
Err: err.Error(),