summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-04-23 20:20:45 -0400
committerGitHub <noreply@github.com>2023-04-23 20:20:45 -0400
commita2f52f356172f4dd04a6fcdfc5de6cf9d0bbb09c (patch)
treeb0238f2deeed202225fb443f2c7b69f44cb2355b
parent65de747b132655fd0525afb3ff1bba9b65aaa1e9 (diff)
downloadgitea-a2f52f356172f4dd04a6fcdfc5de6cf9d0bbb09c.tar.gz
gitea-a2f52f356172f4dd04a6fcdfc5de6cf9d0bbb09c.zip
Fix bug when deleting wiki with no code write permission (#24274) (#24295)
Backport #24274 by @lunny Fix #24125 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
-rw-r--r--services/wiki/wiki.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/services/wiki/wiki.go b/services/wiki/wiki.go
index e5cb2db02b..1edb034004 100644
--- a/services/wiki/wiki.go
+++ b/services/wiki/wiki.go
@@ -366,7 +366,13 @@ func DeleteWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model
if err := git.Push(gitRepo.Ctx, basePath, git.PushOptions{
Remote: DefaultRemote,
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 {
if git.IsErrPushOutOfDate(err) || git.IsErrPushRejected(err) {
return err