mirror of
https://github.com/go-gitea/gitea
synced 2025-01-08 00:44:26 +00:00
This commit is contained in:
parent
968c04c7da
commit
96fff862dc
@ -5,6 +5,7 @@ package pull
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
repo_model "code.gitea.io/gitea/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
@ -66,7 +67,10 @@ func doMergeStyleSquash(ctx *mergeContext, message string) error {
|
|||||||
|
|
||||||
if setting.Repository.PullRequest.AddCoCommitterTrailers && ctx.committer.String() != sig.String() {
|
if setting.Repository.PullRequest.AddCoCommitterTrailers && ctx.committer.String() != sig.String() {
|
||||||
// add trailer
|
// add trailer
|
||||||
message += fmt.Sprintf("\nCo-authored-by: %s\nCo-committed-by: %s\n", sig.String(), sig.String())
|
if !strings.Contains(message, fmt.Sprintf("Co-authored-by: %s", sig.String())) {
|
||||||
|
message += fmt.Sprintf("\nCo-authored-by: %s", sig.String())
|
||||||
|
}
|
||||||
|
message += fmt.Sprintf("\nCo-committed-by: %s\n", sig.String())
|
||||||
}
|
}
|
||||||
cmdCommit := git.NewCommand(ctx, "commit").
|
cmdCommit := git.NewCommand(ctx, "commit").
|
||||||
AddOptionFormat("--author='%s <%s>'", sig.Name, sig.Email).
|
AddOptionFormat("--author='%s <%s>'", sig.Name, sig.Email).
|
||||||
|
Loading…
Reference in New Issue
Block a user