mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 14:07:20 +00:00
Don't create duplicated functions for code repositories and wiki repositories (#33924)
Fix https://github.com/go-gitea/gitea/pull/33910#pullrequestreview-2688913865 This PR changed the Repositroy interface in `gitrepo` package which makes it only focus the relative path in the disk and abstract whether it's a wiki repository or not.
This commit is contained in:
@ -476,7 +476,7 @@ func findEntryForFile(commit *git.Commit, target string) (*git.TreeEntry, error)
|
||||
// findWikiRepoCommit opens the wiki repo and returns the latest commit, writing to context on error.
|
||||
// The caller is responsible for closing the returned repo again
|
||||
func findWikiRepoCommit(ctx *context.APIContext) (*git.Repository, *git.Commit) {
|
||||
wikiRepo, err := gitrepo.OpenWikiRepository(ctx, ctx.Repo.Repository)
|
||||
wikiRepo, err := gitrepo.OpenRepository(ctx, ctx.Repo.Repository.WikiStorageRepo())
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) || err.Error() == "no such file or directory" {
|
||||
ctx.APIErrorNotFound(err)
|
||||
|
Reference in New Issue
Block a user