1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-28 03:28:13 +00:00

Move HasWiki to repository service package (#33912)

Move HasWiki out of the models package to avoid referencing the absolute
wiki path directly.
This commit is contained in:
Lunny Xiao
2025-09-01 11:12:58 -07:00
committed by GitHub
parent ea96ff6b0c
commit 4e1b8db1fc
17 changed files with 76 additions and 54 deletions

View File

@@ -229,6 +229,10 @@ func RelativePath(ownerName, repoName string) string {
return strings.ToLower(ownerName) + "/" + strings.ToLower(repoName) + ".git"
}
func RelativeWikiPath(ownerName, repoName string) string {
return strings.ToLower(ownerName) + "/" + strings.ToLower(repoName) + ".wiki.git"
}
// RelativePath should be an unix style path like username/reponame.git
func (repo *Repository) RelativePath() string {
return RelativePath(repo.OwnerName, repo.Name)
@@ -242,7 +246,7 @@ func (sr StorageRepo) RelativePath() string {
}
func (repo *Repository) WikiStorageRepo() StorageRepo {
return StorageRepo(strings.ToLower(repo.OwnerName) + "/" + strings.ToLower(repo.Name) + ".wiki.git")
return StorageRepo(RelativeWikiPath(repo.OwnerName, repo.Name))
}
// SanitizedOriginalURL returns a sanitized OriginalURL