···
// MergeOptions specifies the configuration for a merge operation
type MergeOptions struct {
func (e ErrMerge) Error() string {
···
exec.Command("git", "-C", tmpDir, "config", "advice.mergeConflict", "false").Run()
// if patch is a format-patch, apply using 'git am'
···
authorName := opts.AuthorName
authorEmail := opts.AuthorEmail
-
authorEmail = "noreply@tangled.sh"
commitArgs = append(commitArgs, "--author", fmt.Sprintf("%s <%s>", authorName, authorEmail))
commitArgs = append(commitArgs, "-m", opts.CommitMessage)
···
// MergeOptions specifies the configuration for a merge operation
type MergeOptions struct {
func (e ErrMerge) Error() string {
···
+
// configure default git user before merge
+
exec.Command("git", "-C", tmpDir, "config", "user.name", opts.CommitterName).Run()
+
exec.Command("git", "-C", tmpDir, "config", "user.email", opts.CommitterEmail).Run()
exec.Command("git", "-C", tmpDir, "config", "advice.mergeConflict", "false").Run()
// if patch is a format-patch, apply using 'git am'
···
authorName := opts.AuthorName
authorEmail := opts.AuthorEmail
+
if authorName != "" && authorEmail != "" {
commitArgs = append(commitArgs, "--author", fmt.Sprintf("%s <%s>", authorName, authorEmail))
+
// else, will default to knot's global user.name & user.email configured via `KNOT_GIT_USER_*` env variables
commitArgs = append(commitArgs, "-m", opts.CommitMessage)