1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-12 13:37:20 +00:00

enhancement: add signoff option in commit form (#14516)

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
a1012112796
2021-01-29 16:57:45 +08:00
committed by GitHub
parent f761c82c94
commit f19da14c34
11 changed files with 51 additions and 8 deletions

View File

@ -25,6 +25,7 @@ type DeleteRepoFileOptions struct {
Author *IdentityOptions
Committer *IdentityOptions
Dates *CommitDateOptions
Signoff bool
}
// DeleteRepoFile deletes a file in the given repository
@ -199,9 +200,9 @@ func DeleteRepoFile(repo *models.Repository, doer *models.User, opts *DeleteRepo
// Now commit the tree
var commitHash string
if opts.Dates != nil {
commitHash, err = t.CommitTreeWithDate(author, committer, treeHash, message, opts.Dates.Author, opts.Dates.Committer)
commitHash, err = t.CommitTreeWithDate(author, committer, treeHash, message, opts.Signoff, opts.Dates.Author, opts.Dates.Committer)
} else {
commitHash, err = t.CommitTree(author, committer, treeHash, message)
commitHash, err = t.CommitTree(author, committer, treeHash, message, opts.Signoff)
}
if err != nil {
return nil, err