aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index b628e7521b..485523a0f1 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -264,6 +264,14 @@ func (repo *Repository) RepoPath() (string, error) {
return repo.repoPath(x)
}
+func (repo *Repository) WikiPath() (string, error) {
+ if err := repo.GetOwner(); err != nil {
+ return "", err
+ }
+
+ return WikiPath(repo.Owner.Name, repo.Name), nil
+}
+
func (repo *Repository) RepoLink() (string, error) {
if err := repo.GetOwner(); err != nil {
return "", err
@@ -877,6 +885,11 @@ func RepoPath(userName, repoName string) string {
return filepath.Join(UserPath(userName), strings.ToLower(repoName)+".git")
}
+// WikiPath returns wiki data path by given user and repository name.
+func WikiPath(userName, repoName string) string {
+ return filepath.Join(UserPath(userName), strings.ToLower(repoName)+".wiki.git")
+}
+
// TransferOwnership transfers all corresponding setting from old user to new one.
func TransferOwnership(u *User, newOwnerName string, repo *Repository) error {
newOwner, err := GetUserByName(newOwnerName)