From be523152a819f6edfb1a257f5cebcb36fc96fc14 Mon Sep 17 00:00:00 2001 From: Mike Fellows Date: Sat, 4 Nov 2017 14:36:49 -0700 Subject: [PATCH] Clean repository ROOT directory name with filepath.Clean (#2846) For better compatibility with Windows. --- modules/setting/setting.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index d22bb24f94..62d4d5eeb5 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -971,9 +971,9 @@ func NewContext() { RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gitea-repositories")) forcePathSeparator(RepoRootPath) if !filepath.IsAbs(RepoRootPath) { - RepoRootPath = path.Join(AppWorkPath, RepoRootPath) + RepoRootPath = filepath.Join(AppWorkPath, RepoRootPath) } else { - RepoRootPath = path.Clean(RepoRootPath) + RepoRootPath = filepath.Clean(RepoRootPath) } ScriptType = sec.Key("SCRIPT_TYPE").MustString("bash") if err = Cfg.Section("repository").MapTo(&Repository); err != nil { -- 2.39.5