Skip to content

Commit

Permalink
Fix bug when deleting wiki with no code write permission (#24274) (#2…
Browse files Browse the repository at this point in the history
…4295)

Backport #24274 by @lunny

Fix #24125

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
  • Loading branch information
3 people committed Apr 24, 2023
1 parent 65de747 commit a2f52f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion services/wiki/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2f52f3

Please sign in to comment.