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

@@ -114,11 +114,19 @@ func CherryPickPost(ctx *context.Context) {
message += "\n\n" + form.CommitMessage
}
gitCommitter, valid := WebGitOperationGetCommitChosenEmailIdentity(ctx, form.CommitEmail)
if !valid {
ctx.Data["Err_CommitEmail"] = true
ctx.RenderWithErr(ctx.Tr("repo.editor.invalid_commit_email"), tplCherryPick, &form)
return
}
opts := &files.ApplyDiffPatchOptions{
LastCommitID: form.LastCommit,
OldBranch: ctx.Repo.BranchName,
NewBranch: branchName,
Message: message,
Author: gitCommitter,
Committer: gitCommitter,
}
// First lets try the simple plain read-tree -m approach