aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
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 /cmd
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 'cmd')
-rw-r--r--cmd/restore_repo.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/restore_repo.go b/cmd/restore_repo.go
index 357bd92c77..f0b01e7984 100644
--- a/cmd/restore_repo.go
+++ b/cmd/restore_repo.go
@@ -43,6 +43,10 @@ var CmdRestoreRepository = cli.Command{
Usage: `Which items will be restored, one or more units should be separated as comma.
wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments are allowed. Empty means all units.`,
},
+ cli.BoolFlag{
+ Name: "validation",
+ Usage: "Sanity check the content of the files before trying to load them",
+ },
},
}
@@ -58,6 +62,7 @@ func runRestoreRepository(c *cli.Context) error {
c.String("owner_name"),
c.String("repo_name"),
c.StringSlice("units"),
+ c.Bool("validation"),
)
if statusCode == http.StatusOK {
return nil