Skip to content

Commit 76c1d29

Browse files
Store repository data in data path if not previously set
1 parent c3fc190 commit 76c1d29

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

modules/setting/repository.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
"strings"
1111

1212
"code.gitea.io/gitea/modules/log"
13-
14-
"github.com/unknwon/com"
1513
)
1614

1715
// enumerates all the policy repository creating
@@ -249,19 +247,14 @@ var (
249247
)
250248

251249
func newRepository() {
252-
homeDir, err := com.HomeDir()
253-
if err != nil {
254-
log.Fatal("Failed to get home directory: %v", err)
255-
}
256-
homeDir = strings.ReplaceAll(homeDir, "\\", "/")
257-
250+
var err error
258251
// Determine and create root git repository path.
259252
sec := Cfg.Section("repository")
260253
Repository.DisableHTTPGit = sec.Key("DISABLE_HTTP_GIT").MustBool()
261254
Repository.UseCompatSSHURI = sec.Key("USE_COMPAT_SSH_URI").MustBool()
262255
Repository.MaxCreationLimit = sec.Key("MAX_CREATION_LIMIT").MustInt(-1)
263256
Repository.DefaultBranch = sec.Key("DEFAULT_BRANCH").MustString(Repository.DefaultBranch)
264-
RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gitea-repositories"))
257+
RepoRootPath = sec.Key("ROOT").MustString(path.Join(AppDataPath, "gitea-repositories"))
265258
forcePathSeparator(RepoRootPath)
266259
if !filepath.IsAbs(RepoRootPath) {
267260
RepoRootPath = filepath.Join(AppWorkPath, RepoRootPath)

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ architectures:
1818

1919
environment:
2020
GITEA_CUSTOM: "$SNAP_COMMON"
21-
GITEA_WORK_DIR: "$SNAP_DATA"
21+
GITEA_WORK_DIR: "$SNAP_COMMON"
2222
GIT_TEMPLATE_DIR: "$SNAP/usr/share/git-core/templates"
2323
GIT_EXEC_PATH: "$SNAP/usr/lib/git-core"
2424

0 commit comments

Comments
 (0)