Skip to content

Commit ed8586a

Browse files
committed
fix: support delete non-urlencoded wiki page
1 parent 2256499 commit ed8586a

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

services/wiki/wiki.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,7 @@ func DeleteWikiPage(doer *models.User, repo *models.Repository, wikiName string)
308308
return fmt.Errorf("Unable to read HEAD tree to index in: %s %v", basePath, err)
309309
}
310310

311-
wikiPath := NameToFilename(wikiName)
312-
filesInIndex, err := gitRepo.LsFiles(wikiPath)
313-
found := false
314-
for _, file := range filesInIndex {
315-
if file == wikiPath {
316-
found = true
317-
break
318-
}
319-
}
311+
found, wikiPath, err := prepareWikiFileName(gitRepo, wikiName)
320312
if found {
321313
err := gitRepo.RemoveFilesFromIndex(wikiPath)
322314
if err != nil {

0 commit comments

Comments
 (0)