summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorPhil Hopper <philhopper@sibertec.com>2017-06-06 05:09:54 -0400
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-06-06 04:09:54 -0500
commit6ec07a6bd7d1f88f0685efa4e1b62a32cbb25e43 (patch)
treefa6b6ef919193243d640b814b8ca82dbb5bd9d27 /models/repo.go
parentcbdd5f787c2124ab604c9ab60b1de20c05a26b4c (diff)
downloadgitea-6ec07a6bd7d1f88f0685efa4e1b62a32cbb25e43.tar.gz
gitea-6ec07a6bd7d1f88f0685efa4e1b62a32cbb25e43.zip
Make `LocalCopyPath` a setting instead of a hard-coded path (#1881)
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index 7aaeb6e0e7..f92f753b92 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -676,7 +676,10 @@ func (repo *Repository) DescriptionHTML() template.HTML {
// LocalCopyPath returns the local repository copy path
func (repo *Repository) LocalCopyPath() string {
- return path.Join(setting.AppDataPath, "tmp/local-repo", com.ToStr(repo.ID))
+ if filepath.IsAbs(setting.Repository.Local.LocalCopyPath) {
+ return path.Join(setting.Repository.Local.LocalCopyPath, com.ToStr(repo.ID))
+ }
+ return path.Join(setting.AppDataPath, setting.Repository.Local.LocalCopyPath, com.ToStr(repo.ID))
}
// UpdateLocalCopyBranch pulls latest changes of given branch from repoPath to localPath.