Skip to content

Commit

Permalink
Add default commit messages to PR for squash merge (#20618) (#20645)
Browse files Browse the repository at this point in the history
Keep the same behavior as 1.16

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>

Co-authored-by: Tyrone Yeh <tyrone_yeh@draytek.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
  • Loading branch information
3 people authored Aug 4, 2022
1 parent bd2218e commit 76accb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions routers/web/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
return nil
}
ctx.Data["GetCommitMessages"] = pull_service.GetSquashMergeCommitMessages(ctx, pull)
} else {
ctx.Data["GetCommitMessages"] = ""
}

sha, err := baseGitRepo.GetRefCommitID(pull.GetGitRefName())
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/view_content/pull.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}},
'textDoMerge': {{$.i18n.Tr "repo.pulls.squash_merge_pull_request"}},
'mergeTitleFieldText': defaultSquashMergeTitle,
'mergeMessageFieldText': defaultMergeMessage,
'mergeMessageFieldText': {{.GetCommitMessages}} + defaultMergeMessage,
'hideAutoMerge': generalHideAutoMerge,
},
{
Expand Down

0 comments on commit 76accb5

Please sign in to comment.