aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2020-12-15 16:52:59 -0500
committerGitHub <noreply@github.com>2020-12-15 16:52:59 -0500
commit88b585c2e08d43af705cec178c1c7771f5d66e70 (patch)
treebf1f9b12b1560de67e835e16c62ef5e8e16e5ae9 /modules/setting
parentb8c58edf39fff0df51b8e9d95bc7fdbb1b1092f7 (diff)
downloadgitea-88b585c2e08d43af705cec178c1c7771f5d66e70.tar.gz
gitea-88b585c2e08d43af705cec178c1c7771f5d66e70.zip
Store repository data in data path if not previously set (#13991)
* Store repository data in data path if not previously set * update docs * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-authored-by: silverwind <me@silverwind.io> * update docs Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/repository.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/modules/setting/repository.go b/modules/setting/repository.go
index f5237ddf0d..328a09454b 100644
--- a/modules/setting/repository.go
+++ b/modules/setting/repository.go
@@ -10,8 +10,6 @@ import (
"strings"
"code.gitea.io/gitea/modules/log"
-
- "github.com/unknwon/com"
)
// enumerates all the policy repository creating
@@ -249,19 +247,14 @@ var (
)
func newRepository() {
- homeDir, err := com.HomeDir()
- if err != nil {
- log.Fatal("Failed to get home directory: %v", err)
- }
- homeDir = strings.ReplaceAll(homeDir, "\\", "/")
-
+ var err error
// Determine and create root git repository path.
sec := Cfg.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)
Repository.DefaultBranch = sec.Key("DEFAULT_BRANCH").MustString(Repository.DefaultBranch)
- RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gitea-repositories"))
+ RepoRootPath = sec.Key("ROOT").MustString(path.Join(AppDataPath, "gitea-repositories"))
forcePathSeparator(RepoRootPath)
if !filepath.IsAbs(RepoRootPath) {
RepoRootPath = filepath.Join(AppWorkPath, RepoRootPath)