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 (#33432)

Initial PR for #24469
This commit is contained in:
wxiaoguang
2025-01-30 09:24:57 +08:00
committed by GitHub
parent ac2d97cb61
commit 256b94e9e9
19 changed files with 356 additions and 182 deletions

View File

@@ -11,7 +11,6 @@ import (
"io"
"path"
"strconv"
"time"
packages_model "code.gitea.io/gitea/models/packages"
repo_model "code.gitea.io/gitea/models/repo"
@@ -296,8 +295,13 @@ func alterRepositoryContent(ctx context.Context, doer *user_model.User, repo *re
return err
}
now := time.Now()
commitHash, err := t.CommitTreeWithDate(lastCommitID, doer, doer, treeHash, commitMessage, false, now, now)
commitOpts := &files_service.CommitTreeUserOptions{
ParentCommitID: lastCommitID,
TreeHash: treeHash,
CommitMessage: commitMessage,
DoerUser: doer,
}
commitHash, err := t.CommitTree(commitOpts)
if err != nil {
return err
}