]> source.dussan.org Git - gitea.git/commitdiff
Fix bug when deleting wiki with no code write permission (#24274)
authorLunny Xiao <xiaolunwen@gmail.com>
Sun, 23 Apr 2023 21:22:16 +0000 (05:22 +0800)
committerGitHub <noreply@github.com>
Sun, 23 Apr 2023 21:22:16 +0000 (17:22 -0400)
Fix #24125

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
services/wiki/wiki.go

index 9ceb8e58177de1e38830760a48ee9b49ea1eac5d..c0183dd2b590a79f636517b9c2975018c564f3ab 100644 (file)
@@ -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