diff options
author | Tyrone Yeh <tyrone_yeh@draytek.com> | 2022-08-03 12:56:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-03 12:56:59 +0800 |
commit | 7a31292c20b057d59889337b7cf7cb419400d6cb (patch) | |
tree | a7bd7426524d77ec2262d4dd1c6d5aa20d72c6e4 | |
parent | 7baa7cb98f2fff18fb483d9fb11c414844af8898 (diff) | |
download | gitea-7a31292c20b057d59889337b7cf7cb419400d6cb.tar.gz gitea-7a31292c20b057d59889337b7cf7cb419400d6cb.zip |
Add default commit messages to PR for squash merge (#20618)
Keep the same behavior as 1.16
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
-rw-r--r-- | routers/web/repo/pull.go | 2 | ||||
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index 2a961c3cbc..7c140a4e59 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -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()) diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 59e0962d17..fd901f013e 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -395,7 +395,7 @@ 'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}}, 'textDoMerge': {{$.locale.Tr "repo.pulls.squash_merge_pull_request"}}, 'mergeTitleFieldText': defaultSquashMergeTitle, - 'mergeMessageFieldText': defaultMergeMessage, + 'mergeMessageFieldText': {{.GetCommitMessages}} + defaultMergeMessage, 'hideAutoMerge': generalHideAutoMerge, }, { |