diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-12-10 06:45:44 +0800 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-12-09 17:45:44 -0500 |
commit | 928417ae39c835edc955c8bb9a02eab2733294c3 (patch) | |
tree | 4258ce8fe27175f8a6628e732b7066dde2d03968 /routers/repo/wiki.go | |
parent | 7e5abe2dc45090c6d6bede9bcf561b506845a332 (diff) | |
download | gitea-928417ae39c835edc955c8bb9a02eab2733294c3.tar.gz gitea-928417ae39c835edc955c8bb9a02eab2733294c3.zip |
Fix empty wiki (#5504)
* fix wiki page when wiki path is exist but empty
* improve the error check
Diffstat (limited to 'routers/repo/wiki.go')
-rw-r--r-- | routers/repo/wiki.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/repo/wiki.go b/routers/repo/wiki.go index 2349236358..7e52129773 100644 --- a/routers/repo/wiki.go +++ b/routers/repo/wiki.go @@ -74,7 +74,6 @@ func findWikiRepoCommit(ctx *context.Context) (*git.Repository, *git.Commit, err commit, err := wikiRepo.GetBranchCommit("master") if err != nil { - ctx.ServerError("GetBranchCommit", err) return wikiRepo, nil, err } return wikiRepo, commit, nil @@ -112,6 +111,9 @@ func wikiContentsByName(ctx *context.Context, commit *git.Commit, wikiName strin func renderWikiPage(ctx *context.Context, isViewPage bool) (*git.Repository, *git.TreeEntry) { wikiRepo, commit, err := findWikiRepoCommit(ctx) if err != nil { + if !git.IsErrNotExist(err) { + ctx.ServerError("GetBranchCommit", err) + } return nil, nil } |