From 2b4f87da46205db98a5caf4c8ccc4dccced2ac81 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 11 Dec 2018 04:37:56 +0800 Subject: Fix empty wiki (#5504) (#5508) * fix wiki page when wiki path is exist but empty * improve the error check --- routers/repo/wiki.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routers/repo/wiki.go b/routers/repo/wiki.go index 3220ab134d..f0e6528d19 100644 --- a/routers/repo/wiki.go +++ b/routers/repo/wiki.go @@ -73,7 +73,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 @@ -111,6 +110,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 } -- cgit v1.2.3