1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Support choose email when creating a commit via web UI (more) (#33445)

Follow #33432
This commit is contained in:
wxiaoguang
2025-01-31 10:36:18 +08:00
committed by GitHub
parent b57d9f41d4
commit 5a7b42dac7
18 changed files with 228 additions and 176 deletions

View File

@@ -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 {