Fix empty wiki (#5504) (#5508)

* fix wiki page when wiki path is exist but empty

* improve the error check
This commit is contained in:
Lunny Xiao 2018-12-11 04:37:56 +08:00 committed by Lauris BH
parent ad9f9cdc30
commit 2b4f87da46

View file

@ -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
}