Fix bug create/edit wiki pages when code master branch protected (#7580) (#7623)

* fix bug create/edit wiki pages when code master branch protected

* improve FullPushingEnvironment function
This commit is contained in:
Lunny Xiao 2019-07-26 09:22:20 +08:00 committed by Lauris BH
parent b7e41f7b8f
commit 4c69e158e5
3 changed files with 18 additions and 6 deletions

View file

@ -217,7 +217,13 @@ func (repo *Repository) updateWikiPage(doer *User, oldWikiName, newWikiName, con
if err := git.Push(basePath, git.PushOptions{
Remote: "origin",
Branch: fmt.Sprintf("%s:%s%s", commitHash.String(), git.BranchPrefix, "master"),
Env: PushingEnvironment(doer, repo),
Env: FullPushingEnvironment(
doer,
doer,
repo,
repo.Name+".wiki",
0,
),
}); err != nil {
log.Error("%v", err)
return fmt.Errorf("Push: %v", err)