Add default commit messages to PR for squash merge (#20618) (#20645)

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>
pull/20663/head
wxiaoguang 2 years ago committed by GitHub
parent bd2218e14c
commit 76accb51ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      routers/web/repo/pull.go
  2. 2
      templates/repo/issue/view_content/pull.tmpl

@ -510,6 +510,8 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
return nil return nil
} }
ctx.Data["GetCommitMessages"] = pull_service.GetSquashMergeCommitMessages(ctx, pull) ctx.Data["GetCommitMessages"] = pull_service.GetSquashMergeCommitMessages(ctx, pull)
} else {
ctx.Data["GetCommitMessages"] = ""
} }
sha, err := baseGitRepo.GetRefCommitID(pull.GetGitRefName()) sha, err := baseGitRepo.GetRefCommitID(pull.GetGitRefName())

@ -396,7 +396,7 @@
'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}}, 'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}},
'textDoMerge': {{$.i18n.Tr "repo.pulls.squash_merge_pull_request"}}, 'textDoMerge': {{$.i18n.Tr "repo.pulls.squash_merge_pull_request"}},
'mergeTitleFieldText': defaultSquashMergeTitle, 'mergeTitleFieldText': defaultSquashMergeTitle,
'mergeMessageFieldText': defaultMergeMessage, 'mergeMessageFieldText': {{.GetCommitMessages}} + defaultMergeMessage,
'hideAutoMerge': generalHideAutoMerge, 'hideAutoMerge': generalHideAutoMerge,
}, },
{ {

Loading…
Cancel
Save