summaryrefslogtreecommitdiffstats
path: root/modules/setting/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/setting/repository.go')
-rw-r--r--modules/setting/repository.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/setting/repository.go b/modules/setting/repository.go
index f53de17a4d..4964704dba 100644
--- a/modules/setting/repository.go
+++ b/modules/setting/repository.go
@@ -270,10 +270,10 @@ var (
}{}
)
-func newRepository() {
+func loadRepositoryFrom(rootCfg ConfigProvider) {
var err error
// Determine and create root git repository path.
- sec := Cfg.Section("repository")
+ sec := rootCfg.Section("repository")
Repository.DisableHTTPGit = sec.Key("DISABLE_HTTP_GIT").MustBool()
Repository.UseCompatSSHURI = sec.Key("USE_COMPAT_SSH_URI").MustBool()
Repository.MaxCreationLimit = sec.Key("MAX_CREATION_LIMIT").MustInt(-1)
@@ -295,19 +295,19 @@ func newRepository() {
log.Warn("SCRIPT_TYPE %q is not on the current PATH. Are you sure that this is the correct SCRIPT_TYPE?", ScriptType)
}
- if err = Cfg.Section("repository").MapTo(&Repository); err != nil {
+ if err = sec.MapTo(&Repository); err != nil {
log.Fatal("Failed to map Repository settings: %v", err)
- } else if err = Cfg.Section("repository.editor").MapTo(&Repository.Editor); err != nil {
+ } else if err = rootCfg.Section("repository.editor").MapTo(&Repository.Editor); err != nil {
log.Fatal("Failed to map Repository.Editor settings: %v", err)
- } else if err = Cfg.Section("repository.upload").MapTo(&Repository.Upload); err != nil {
+ } else if err = rootCfg.Section("repository.upload").MapTo(&Repository.Upload); err != nil {
log.Fatal("Failed to map Repository.Upload settings: %v", err)
- } else if err = Cfg.Section("repository.local").MapTo(&Repository.Local); err != nil {
+ } else if err = rootCfg.Section("repository.local").MapTo(&Repository.Local); err != nil {
log.Fatal("Failed to map Repository.Local settings: %v", err)
- } else if err = Cfg.Section("repository.pull-request").MapTo(&Repository.PullRequest); err != nil {
+ } else if err = rootCfg.Section("repository.pull-request").MapTo(&Repository.PullRequest); err != nil {
log.Fatal("Failed to map Repository.PullRequest settings: %v", err)
}
- if !Cfg.Section("packages").Key("ENABLED").MustBool(true) {
+ if !rootCfg.Section("packages").Key("ENABLED").MustBool(true) {
Repository.DisabledRepoUnits = append(Repository.DisabledRepoUnits, "repo.packages")
}
@@ -354,5 +354,5 @@ func newRepository() {
Repository.Upload.TempPath = path.Join(AppWorkPath, Repository.Upload.TempPath)
}
- RepoArchive.Storage = getStorage("repo-archive", "", nil)
+ RepoArchive.Storage = getStorage(rootCfg, "repo-archive", "", nil)
}