Skip to content

Commit

Permalink
fix: support delete non-urlencoded wiki page (go-gitea#16482)
Browse files Browse the repository at this point in the history
* fix: support delete non-urlencoded wiki page

* fix: check error
  • Loading branch information
BLumia authored Jul 19, 2021
1 parent 2256499 commit e01b782
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions services/wiki/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,9 @@ func DeleteWikiPage(doer *models.User, repo *models.Repository, wikiName string)
return fmt.Errorf("Unable to read HEAD tree to index in: %s %v", basePath, err)
}

wikiPath := NameToFilename(wikiName)
filesInIndex, err := gitRepo.LsFiles(wikiPath)
found := false
for _, file := range filesInIndex {
if file == wikiPath {
found = true
break
}
found, wikiPath, err := prepareWikiFileName(gitRepo, wikiName)
if err != nil {
return err
}
if found {
err := gitRepo.RemoveFilesFromIndex(wikiPath)
Expand Down

0 comments on commit e01b782

Please sign in to comment.