summaryrefslogtreecommitdiffstats
path: root/modules/migrations/restore.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-02-22 11:57:41 +0800
committerGitHub <noreply@github.com>2021-02-22 11:57:41 +0800
commite79dae29cc2fcabc639ff27f28a9adf1fa07b28c (patch)
treee801e6e3a7a0f3fdc2e76ea94e1dfbc5912494b1 /modules/migrations/restore.go
parentcd8b2f32738f4d1dfe23f698d5ce279b571567dd (diff)
downloadgitea-e79dae29cc2fcabc639ff27f28a9adf1fa07b28c.tar.gz
gitea-e79dae29cc2fcabc639ff27f28a9adf1fa07b28c.zip
Fix repo-restore bug with poster not replaced (#14759)
* Fix restore bug * Fix restore bug Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules/migrations/restore.go')
-rw-r--r--modules/migrations/restore.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/migrations/restore.go b/modules/migrations/restore.go
index e1ab408e41..4e63df1429 100644
--- a/modules/migrations/restore.go
+++ b/modules/migrations/restore.go
@@ -53,8 +53,7 @@ func (r *RepositoryRestorer) SetContext(ctx context.Context) {
r.ctx = ctx
}
-// GetRepoInfo returns a repository information
-func (r *RepositoryRestorer) GetRepoInfo() (*base.Repository, error) {
+func (r *RepositoryRestorer) getRepoOptions() (map[string]string, error) {
p := filepath.Join(r.baseDir, "repo.yml")
bs, err := ioutil.ReadFile(p)
if err != nil {
@@ -66,6 +65,15 @@ func (r *RepositoryRestorer) GetRepoInfo() (*base.Repository, error) {
if err != nil {
return nil, err
}
+ return opts, nil
+}
+
+// GetRepoInfo returns a repository information
+func (r *RepositoryRestorer) GetRepoInfo() (*base.Repository, error) {
+ opts, err := r.getRepoOptions()
+ if err != nil {
+ return nil, err
+ }
isPrivate, _ := strconv.ParseBool(opts["is_private"])