]> source.dussan.org Git - gitea.git/commitdiff
Clean repository ROOT directory name with filepath.Clean (#2846)
authorMike Fellows <Mike.Fellows@shaw.ca>
Sat, 4 Nov 2017 21:36:49 +0000 (14:36 -0700)
committerLauris BH <lauris@nix.lv>
Sat, 4 Nov 2017 21:36:49 +0000 (23:36 +0200)
For better compatibility with Windows.

modules/setting/setting.go

index d22bb24f940d5363910657d2083191b0fb622d21..62d4d5eeb50c1e134ca0250a42991123f5217896 100644 (file)
@@ -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 {