aboutsummaryrefslogtreecommitdiff
path: root/internal/route
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/route
parentf59a68c531c680d4488d8d977798f6aa36551bfa (diff)
conf: overhaul repository settings (#5932)
Diffstat (limited to 'internal/route')
-rw-r--r--internal/route/admin/admin.go4
-rw-r--r--internal/route/install.go2
-rw-r--r--internal/route/repo/http.go4
3 files changed, 4 insertions, 6 deletions
diff --git a/internal/route/admin/admin.go b/internal/route/admin/admin.go
index d40a5fc4..3c90e3af 100644
--- a/internal/route/admin/admin.go
+++ b/internal/route/admin/admin.go
@@ -199,13 +199,11 @@ func Config(c *context.Context) {
c.Data["App"] = conf.App
c.Data["Server"] = conf.Server
c.Data["SSH"] = conf.SSH
+ c.Data["Repository"] = conf.Repository
c.Data["LogRootPath"] = conf.LogRootPath
c.Data["ReverseProxyAuthUser"] = conf.ReverseProxyAuthUser
- c.Data["RepoRootPath"] = conf.RepoRootPath
- c.Data["ScriptType"] = conf.ScriptType
- c.Data["Repository"] = conf.Repository
c.Data["HTTP"] = conf.HTTP
c.Data["DbCfg"] = db.DbCfg
diff --git a/internal/route/install.go b/internal/route/install.go
index 0747ebf0..fdc7b18b 100644
--- a/internal/route/install.go
+++ b/internal/route/install.go
@@ -155,7 +155,7 @@ func Install(c *context.Context) {
// Application general settings
f.AppName = conf.App.BrandName
- f.RepoRootPath = conf.RepoRootPath
+ f.RepoRootPath = conf.Repository.Root
// Note(unknwon): it's hard for Windows users change a running user,
// so just use current one if config says default.
diff --git a/internal/route/repo/http.go b/internal/route/repo/http.go
index 9b780dde..07c89326 100644
--- a/internal/route/repo/http.go
+++ b/internal/route/repo/http.go
@@ -19,11 +19,11 @@ import (
"gopkg.in/macaron.v1"
log "unknwon.dev/clog/v2"
+ "gogs.io/gogs/internal/conf"
"gogs.io/gogs/internal/context"
"gogs.io/gogs/internal/db"
"gogs.io/gogs/internal/db/errors"
"gogs.io/gogs/internal/lazyregexp"
- "gogs.io/gogs/internal/conf"
"gogs.io/gogs/internal/tool"
)
@@ -368,7 +368,7 @@ func getGitRepoPath(dir string) (string, error) {
dir += ".git"
}
- filename := path.Join(conf.RepoRootPath, dir)
+ filename := path.Join(conf.Repository.Root, dir)
if _, err := os.Stat(filename); os.IsNotExist(err) {
return "", err
}