aboutsummaryrefslogtreecommitdiff
path: root/internal/repoutil/repoutil.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/repoutil/repoutil.go')
-rw-r--r--internal/repoutil/repoutil.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/repoutil/repoutil.go b/internal/repoutil/repoutil.go
index 658f896f..bb5afc08 100644
--- a/internal/repoutil/repoutil.go
+++ b/internal/repoutil/repoutil.go
@@ -7,6 +7,7 @@ package repoutil
import (
"fmt"
"path/filepath"
+ "strconv"
"strings"
"gogs.io/gogs/internal/conf"
@@ -60,3 +61,15 @@ func UserPath(user string) string {
func RepositoryPath(owner, repo string) string {
return filepath.Join(UserPath(owner), strings.ToLower(repo)+".git")
}
+
+// RepositoryLocalPath returns the absolute path of the repository local copy
+// with the given ID.
+func RepositoryLocalPath(repoID int64) string {
+ return filepath.Join(conf.Server.AppDataPath, "tmp", "local-repo", strconv.FormatInt(repoID, 10))
+}
+
+// RepositoryLocalWikiPath returns the absolute path of the repository local
+// wiki copy with the given ID.
+func RepositoryLocalWikiPath(repoID int64) string {
+ return filepath.Join(conf.Server.AppDataPath, "tmp", "local-wiki", strconv.FormatInt(repoID, 10))
+}