diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-04-24 05:22:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-23 17:22:16 -0400 |
commit | 284b41f45244bbe46fc8feee15bbfdf66d150e79 (patch) | |
tree | feb29a7c5d5c5765b9d531987253af651ce4f289 /services | |
parent | 55a600fa4130b2708464be1c024c22ff46e6d4c0 (diff) | |
download | gitea-284b41f45244bbe46fc8feee15bbfdf66d150e79.tar.gz gitea-284b41f45244bbe46fc8feee15bbfdf66d150e79.zip |
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>
Diffstat (limited to 'services')
-rw-r--r-- | services/wiki/wiki.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/services/wiki/wiki.go b/services/wiki/wiki.go index 9ceb8e5817..c0183dd2b5 100644 --- a/services/wiki/wiki.go +++ b/services/wiki/wiki.go @@ -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{ 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 |