From be1330ec89308f76557bd7fc708b1f16c703f429 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Thu, 11 Jan 2018 01:46:59 +0200 Subject: Remove hardcoded paths to fix randomly failing tests (#3347) * Remove hardcoded paths to fix randomly failing tests * Use correct function for merge path --- models/wiki.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'models/wiki.go') diff --git a/models/wiki.go b/models/wiki.go index 3819eb95f0..3a39daf0f6 100644 --- a/models/wiki.go +++ b/models/wiki.go @@ -90,9 +90,17 @@ func (repo *Repository) InitWiki() error { return nil } +// LocalWikiPath returns the local wiki repository copy path. +func LocalWikiPath() string { + if filepath.IsAbs(setting.Repository.Local.LocalWikiPath) { + return setting.Repository.Local.LocalWikiPath + } + return path.Join(setting.AppDataPath, setting.Repository.Local.LocalWikiPath) +} + // LocalWikiPath returns the path to the local wiki repository (?). func (repo *Repository) LocalWikiPath() string { - return path.Join(setting.AppDataPath, "tmp/local-wiki", com.ToStr(repo.ID)) + return path.Join(LocalWikiPath(), com.ToStr(repo.ID)) } // UpdateLocalWiki makes sure the local copy of repository wiki is up-to-date. -- cgit v1.2.3