mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-08 09:53:10 +02:00
Fix 500 on first wiki page (#16586)
* Fix 500 on first wiki page There is a mistake in #16319 and #16487 which means that the first time a wiki page is created a 500 is reported because the `master` branch is not in existence in that wiki yet. This PR simply checks for this error and returns not found. Fix #16584 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
1 parent
d686d7b052
commit
e51c73ae5c
2 files changed
+32
No files matched your search
@@ -90,6 +90,9 @@ func prepareWikiFileName(gitRepo *git.Repository, wikiName string) (bool, string
|
||||
// Look for both files
|
||||
filesInIndex, err := gitRepo.LsTree("master", unescaped, escaped)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "Not a valid object name master") {
|
||||
return false, escaped, nil
|
||||
}
|
||||
log.Error("%v", err)
|
||||
return false, escaped, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user