Browse Source

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>
tags/v1.19.2
Giteabot 1 year ago
parent
commit
a2f52f3561
No account linked to committer's email address
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      services/wiki/wiki.go

+ 7
- 1
services/wiki/wiki.go View File

@@ -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

Loading…
Cancel
Save