From 00a692afc38587e93f93c35c758faed1a1b2f93a Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 10 Dec 2018 06:45:44 +0800 Subject: [PATCH] Fix empty wiki (#5504) * 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 3220ab134d46..f0e6528d19b6 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 }