mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
[BUG] Implement commit mail selection for other Git operations
- Implement the commit mail selection feature for the other supported Git operations that can be done trough the web UI. - Adds integration tests (goodluck reviewing this). - Ref: #1788 Co-authored-by: 0ko <0ko@noreply.codeberg.org>
This commit is contained in:
parent
2855727c85
commit
64a0d61aff
9 changed files with 377 additions and 152 deletions
|
@ -87,12 +87,19 @@ func NewDiffPatchPost(ctx *context.Context) {
|
|||
message += "\n\n" + form.CommitMessage
|
||||
}
|
||||
|
||||
gitIdenitity := getGitIdentity(ctx, form.CommitMailID, tplPatchFile, &form)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
fileResponse, err := files.ApplyDiffPatch(ctx, ctx.Repo.Repository, ctx.Doer, &files.ApplyDiffPatchOptions{
|
||||
LastCommitID: form.LastCommit,
|
||||
OldBranch: ctx.Repo.BranchName,
|
||||
NewBranch: branchName,
|
||||
Message: message,
|
||||
Content: strings.ReplaceAll(form.Content, "\r", ""),
|
||||
Author: gitIdenitity,
|
||||
Committer: gitIdenitity,
|
||||
})
|
||||
if err != nil {
|
||||
if git_model.IsErrBranchAlreadyExists(err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue