summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-12-10 16:52:05 -0800
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-12-11 08:52:05 +0800
commitd1efe2078a07f74db3f3ce6c33cf0a7da0dec18a (patch)
tree17eb9bbf5f75c12432e53db36bf216c48c7a0ff0 /models
parent41d6afe0e7992567ac7c86cdd41b9226aae896d2 (diff)
downloadgitea-d1efe2078a07f74db3f3ce6c33cf0a7da0dec18a.tar.gz
gitea-d1efe2078a07f74db3f3ce6c33cf0a7da0dec18a.zip
Fix integration tests (#3141)
Diffstat (limited to 'models')
-rw-r--r--models/repo.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/models/repo.go b/models/repo.go
index 3142b324f1..77a960deb7 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -757,12 +757,17 @@ func (repo *Repository) DescriptionHTML() template.HTML {
return template.HTML(descPattern.ReplaceAllStringFunc(markup.Sanitize(repo.Description), sanitize))
}
-// LocalCopyPath returns the local repository copy path
-func (repo *Repository) LocalCopyPath() string {
+// LocalCopyPath returns the local repository copy path.
+func LocalCopyPath() string {
if filepath.IsAbs(setting.Repository.Local.LocalCopyPath) {
- return path.Join(setting.Repository.Local.LocalCopyPath, com.ToStr(repo.ID))
+ return setting.Repository.Local.LocalCopyPath
}
- return path.Join(setting.AppDataPath, setting.Repository.Local.LocalCopyPath, com.ToStr(repo.ID))
+ return path.Join(setting.AppDataPath, setting.Repository.Local.LocalCopyPath)
+}
+
+// LocalCopyPath returns the local repository copy path for the given repo.
+func (repo *Repository) LocalCopyPath() string {
+ return path.Join(LocalCopyPath(), com.ToStr(repo.ID))
}
// UpdateLocalCopyBranch pulls latest changes of given branch from repoPath to localPath.