aboutsummaryrefslogtreecommitdiff
path: root/internal/db/migrations
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-22 15:22:32 +0800
committerGitHub <noreply@github.com>2020-02-22 15:22:32 +0800
commitc4a0a404735cdcfdcb805e9fed474c75110bca89 (patch)
treed4ef0af7722425451f23b6ca06ef90a375a5f6bc /internal/db/migrations
parentf59a68c531c680d4488d8d977798f6aa36551bfa (diff)
conf: overhaul repository settings (#5932)
Diffstat (limited to 'internal/db/migrations')
-rw-r--r--internal/db/migrations/v15.go8
-rw-r--r--internal/db/migrations/v16.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/internal/db/migrations/v15.go b/internal/db/migrations/v15.go
index 72d24143..0631e472 100644
--- a/internal/db/migrations/v15.go
+++ b/internal/db/migrations/v15.go
@@ -32,9 +32,9 @@ func generateAndMigrateGitHooks(x *xorm.Engine) (err error) {
var (
hookNames = []string{"pre-receive", "update", "post-receive"}
hookTpls = []string{
- fmt.Sprintf("#!/usr/bin/env %s\n\"%s\" hook --config='%s' pre-receive\n", conf.ScriptType, conf.AppPath(), conf.CustomConf),
- fmt.Sprintf("#!/usr/bin/env %s\n\"%s\" hook --config='%s' update $1 $2 $3\n", conf.ScriptType, conf.AppPath(), conf.CustomConf),
- fmt.Sprintf("#!/usr/bin/env %s\n\"%s\" hook --config='%s' post-receive\n", conf.ScriptType, conf.AppPath(), conf.CustomConf),
+ fmt.Sprintf("#!/usr/bin/env %s\n\"%s\" hook --config='%s' pre-receive\n", conf.Repository.ScriptType, conf.AppPath(), conf.CustomConf),
+ fmt.Sprintf("#!/usr/bin/env %s\n\"%s\" hook --config='%s' update $1 $2 $3\n", conf.Repository.ScriptType, conf.AppPath(), conf.CustomConf),
+ fmt.Sprintf("#!/usr/bin/env %s\n\"%s\" hook --config='%s' post-receive\n", conf.Repository.ScriptType, conf.AppPath(), conf.CustomConf),
}
)
@@ -63,7 +63,7 @@ func generateAndMigrateGitHooks(x *xorm.Engine) (err error) {
return nil
}
- repoBase := filepath.Join(conf.RepoRootPath, strings.ToLower(user.Name), strings.ToLower(repo.Name))
+ repoBase := filepath.Join(conf.Repository.Root, strings.ToLower(user.Name), strings.ToLower(repo.Name))
repoPath := repoBase + ".git"
wikiPath := repoBase + ".wiki.git"
log.Trace("[%04d]: %s", idx, repoPath)
diff --git a/internal/db/migrations/v16.go b/internal/db/migrations/v16.go
index 91bf4925..572dba9c 100644
--- a/internal/db/migrations/v16.go
+++ b/internal/db/migrations/v16.go
@@ -60,7 +60,7 @@ func updateRepositorySizes(x *xorm.Engine) (err error) {
continue
}
- repoPath := filepath.Join(conf.RepoRootPath, strings.ToLower(user.Name), strings.ToLower(repo.Name)) + ".git"
+ repoPath := filepath.Join(conf.Repository.Root, strings.ToLower(user.Name), strings.ToLower(repo.Name)) + ".git"
countObject, err := git.GetRepoSize(repoPath)
if err != nil {
log.Warn("GetRepoSize: %v", err)