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:
@@ -11,7 +11,6 @@ import (
|
||||
"strings"
|
||||
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
)
|
||||
|
||||
@@ -86,12 +85,3 @@ func WikiPath(userName, repoName string) string {
|
||||
func (repo *Repository) WikiPath() string {
|
||||
return WikiPath(repo.OwnerName, repo.Name)
|
||||
}
|
||||
|
||||
// HasWiki returns true if repository has wiki.
|
||||
func (repo *Repository) HasWiki() bool {
|
||||
isDir, err := util.IsDir(repo.WikiPath())
|
||||
if err != nil {
|
||||
log.Error("Unable to check if %s is a directory: %v", repo.WikiPath(), err)
|
||||
}
|
||||
return isDir
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user