diff options
Diffstat (limited to 'services')
-rw-r--r-- | services/forms/repo_form.go | 3 | ||||
-rw-r--r-- | services/repository/files/upload.go | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go index 40e15f2d5c..2c6373e03c 100644 --- a/services/forms/repo_form.go +++ b/services/forms/repo_form.go @@ -756,6 +756,7 @@ type CherryPickForm struct { LastCommit string Revert bool Signoff bool + CommitEmail string } // Validate validates the fields @@ -781,6 +782,7 @@ type UploadRepoFileForm struct { NewBranchName string `binding:"GitRefName;MaxSize(100)"` Files []string Signoff bool + CommitEmail string } // Validate validates the fields @@ -815,6 +817,7 @@ type DeleteRepoFileForm struct { NewBranchName string `binding:"GitRefName;MaxSize(100)"` LastCommit string Signoff bool + CommitEmail string } // Validate validates the fields diff --git a/services/repository/files/upload.go b/services/repository/files/upload.go index af32bc4c85..3c58598427 100644 --- a/services/repository/files/upload.go +++ b/services/repository/files/upload.go @@ -27,6 +27,8 @@ type UploadRepoFileOptions struct { Message string Files []string // In UUID format. Signoff bool + Author *IdentityOptions + Committer *IdentityOptions } type uploadInfo struct { @@ -130,11 +132,13 @@ func UploadRepoFiles(ctx context.Context, repo *repo_model.Repository, doer *use // Now commit the tree commitOpts := &CommitTreeUserOptions{ - ParentCommitID: opts.LastCommitID, - TreeHash: treeHash, - CommitMessage: opts.Message, - SignOff: opts.Signoff, - DoerUser: doer, + ParentCommitID: opts.LastCommitID, + TreeHash: treeHash, + CommitMessage: opts.Message, + SignOff: opts.Signoff, + DoerUser: doer, + AuthorIdentity: opts.Author, + CommitterIdentity: opts.Committer, } commitHash, err := t.CommitTree(commitOpts) if err != nil { |