diff options
author | 无闻 <joe2010xtmf@163.com> | 2014-06-24 09:30:16 -0400 |
---|---|---|
committer | 无闻 <joe2010xtmf@163.com> | 2014-06-24 09:30:16 -0400 |
commit | 63770d93a1e052140d75ebed83e4927f15e007fe (patch) | |
tree | 6da764d6e07f2a018a4459af7372437451ee2c64 | |
parent | 9bdff5bd979588ad7fe7a979960616e9c3eae396 (diff) | |
parent | 29a40c97f367a432e4038f20f09d7bf76ce4ab93 (diff) | |
download | gitea-63770d93a1e052140d75ebed83e4927f15e007fe.tar.gz gitea-63770d93a1e052140d75ebed83e4927f15e007fe.zip |
Merge pull request #251 from niphor/master
RepoRootPath must be absolute path
-rw-r--r-- | modules/setting/setting.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 1298996396..cb7734bb32 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -182,6 +182,12 @@ func NewConfigContext() { log.Fatal("Fail to get home directory: %v", err) } RepoRootPath = Cfg.MustValue("repository", "ROOT", filepath.Join(homeDir, "gogs-repositories")) + if !filepath.IsAbs(RepoRootPath) { + RepoRootPath = filepath.Join(workDir, RepoRootPath) + } else { + RepoRootPath = filepath.Clean(RepoRootPath) + } + if err = os.MkdirAll(RepoRootPath, os.ModePerm); err != nil { log.Fatal("Fail to create repository root path(%s): %v", RepoRootPath, err) } |