diff options
author | a1012112796 <1012112796@qq.com> | 2021-01-29 16:57:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 16:57:45 +0800 |
commit | f19da14c34f3a86a77b45de77f48109fa5edcf78 (patch) | |
tree | 4fff1a4533cebf812334327e2bfaf9743a90bb64 /modules/repofiles/update.go | |
parent | f761c82c94f27193bfb6cd0648e11e491eda4880 (diff) | |
download | gitea-f19da14c34f3a86a77b45de77f48109fa5edcf78.tar.gz gitea-f19da14c34f3a86a77b45de77f48109fa5edcf78.zip |
enhancement: add signoff option in commit form (#14516)
Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'modules/repofiles/update.go')
-rw-r--r-- | modules/repofiles/update.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/repofiles/update.go b/modules/repofiles/update.go index a1a9c624d7..0ee1ada34c 100644 --- a/modules/repofiles/update.go +++ b/modules/repofiles/update.go @@ -51,6 +51,7 @@ type UpdateRepoFileOptions struct { Author *IdentityOptions Committer *IdentityOptions Dates *CommitDateOptions + Signoff bool } func detectEncodingAndBOM(entry *git.TreeEntry, repo *models.Repository) (string, bool) { @@ -417,9 +418,9 @@ func CreateOrUpdateRepoFile(repo *models.Repository, doer *models.User, opts *Up // 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 |