mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	fix: support delete non-urlencoded wiki page (#16482)
* fix: support delete non-urlencoded wiki page * fix: check error
This commit is contained in:
		@@ -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)
 | 
							return fmt.Errorf("Unable to read HEAD tree to index in: %s %v", basePath, err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wikiPath := NameToFilename(wikiName)
 | 
						found, wikiPath, err := prepareWikiFileName(gitRepo, wikiName)
 | 
				
			||||||
	filesInIndex, err := gitRepo.LsFiles(wikiPath)
 | 
						if err != nil {
 | 
				
			||||||
	found := false
 | 
							return err
 | 
				
			||||||
	for _, file := range filesInIndex {
 | 
					 | 
				
			||||||
		if file == wikiPath {
 | 
					 | 
				
			||||||
			found = true
 | 
					 | 
				
			||||||
			break
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if found {
 | 
						if found {
 | 
				
			||||||
		err := gitRepo.RemoveFilesFromIndex(wikiPath)
 | 
							err := gitRepo.RemoveFilesFromIndex(wikiPath)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user