mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix bug when deleting wiki with no code write permission (#24274)
Fix #24125 Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
		@@ -321,7 +321,13 @@ func DeleteWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model
 | 
				
			|||||||
	if err := git.Push(gitRepo.Ctx, basePath, git.PushOptions{
 | 
						if err := git.Push(gitRepo.Ctx, basePath, git.PushOptions{
 | 
				
			||||||
		Remote: DefaultRemote,
 | 
							Remote: DefaultRemote,
 | 
				
			||||||
		Branch: fmt.Sprintf("%s:%s%s", commitHash.String(), git.BranchPrefix, DefaultBranch),
 | 
							Branch: fmt.Sprintf("%s:%s%s", commitHash.String(), git.BranchPrefix, DefaultBranch),
 | 
				
			||||||
		Env:    repo_module.PushingEnvironment(doer, repo),
 | 
							Env: repo_module.FullPushingEnvironment(
 | 
				
			||||||
 | 
								doer,
 | 
				
			||||||
 | 
								doer,
 | 
				
			||||||
 | 
								repo,
 | 
				
			||||||
 | 
								repo.Name+".wiki",
 | 
				
			||||||
 | 
								0,
 | 
				
			||||||
 | 
							),
 | 
				
			||||||
	}); err != nil {
 | 
						}); err != nil {
 | 
				
			||||||
		if git.IsErrPushOutOfDate(err) || git.IsErrPushRejected(err) {
 | 
							if git.IsErrPushOutOfDate(err) || git.IsErrPushRejected(err) {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user