From 04ca6826db3c4bd1d40ab2db0b42977eead7828d Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 24 Apr 2023 05:22:16 +0800 Subject: [PATCH] Fix bug when deleting wiki with no code write permission (#24274) Fix #24125 Co-authored-by: Giteabot Co-authored-by: silverwind --- services/wiki/wiki.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/wiki/wiki.go b/services/wiki/wiki.go index e5cb2db02bde..1edb03400492 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