aboutsummaryrefslogtreecommitdiffstats
path: root/services/wiki/wiki.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/wiki/wiki.go')
-rw-r--r--services/wiki/wiki.go19
1 files changed, 15 insertions, 4 deletions
diff --git a/services/wiki/wiki.go b/services/wiki/wiki.go
index 3616823c5d..fab02bae0c 100644
--- a/services/wiki/wiki.go
+++ b/services/wiki/wiki.go
@@ -185,16 +185,22 @@ func updateWikiPage(doer *models.User, repo *models.Repository, oldWikiName, new
Message: message,
}
- sign, signingKey, _ := repo.SignWikiCommit(doer)
+ committer := doer.NewGitSig()
+
+ sign, signingKey, signer, _ := repo.SignWikiCommit(doer)
if sign {
commitTreeOpts.KeyID = signingKey
+ if repo.GetTrustModel() == models.CommitterTrustModel || repo.GetTrustModel() == models.CollaboratorCommitterTrustModel {
+ committer = signer
+ }
} else {
commitTreeOpts.NoGPGSign = true
}
if hasMasterBranch {
commitTreeOpts.Parents = []string{"HEAD"}
}
- commitHash, err := gitRepo.CommitTree(doer.NewGitSig(), tree, commitTreeOpts)
+
+ commitHash, err := gitRepo.CommitTree(doer.NewGitSig(), committer, tree, commitTreeOpts)
if err != nil {
log.Error("%v", err)
return err
@@ -302,14 +308,19 @@ func DeleteWikiPage(doer *models.User, repo *models.Repository, wikiName string)
Parents: []string{"HEAD"},
}
- sign, signingKey, _ := repo.SignWikiCommit(doer)
+ committer := doer.NewGitSig()
+
+ sign, signingKey, signer, _ := repo.SignWikiCommit(doer)
if sign {
commitTreeOpts.KeyID = signingKey
+ if repo.GetTrustModel() == models.CommitterTrustModel || repo.GetTrustModel() == models.CollaboratorCommitterTrustModel {
+ committer = signer
+ }
} else {
commitTreeOpts.NoGPGSign = true
}
- commitHash, err := gitRepo.CommitTree(doer.NewGitSig(), tree, commitTreeOpts)
+ commitHash, err := gitRepo.CommitTree(doer.NewGitSig(), committer, tree, commitTreeOpts)
if err != nil {
return err
}