mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-06 23:02:06 +01:00
Pusher is author of manual merged changes
When ff-only merge of a PR happens, the pusher is the de-facto author of the merge, not the last committer in the PR submission.
This commit is contained in:
parent
5e5703694d
commit
fb6d898a71
@ -362,7 +362,17 @@ func manuallyMerged(ctx context.Context, pr *issues_model.PullRequest) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
merger, _ := user_model.GetUserByEmail(ctx, commit.Author.Email)
|
||||
var merger *user_model.User
|
||||
if commit.ParentCount() > 1 {
|
||||
merger, _ = user_model.GetUserByEmail(ctx, commit.Author.Email)
|
||||
} else {
|
||||
branch, err := git_model.GetBranch(ctx, pr.BaseRepoID, pr.BaseBranch)
|
||||
if err == nil {
|
||||
if err = branch.LoadPusher(ctx); err == nil {
|
||||
merger = branch.Pusher
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// When the commit author is unknown set the BaseRepo owner as merger
|
||||
if merger == nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user