Skip to content

Commit

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

Co-authored-by: wxiaoguang <[email protected]>
Co-authored-by: John Olheiser <[email protected]>
  • Loading branch information
3 people committed Aug 3, 2022
1 parent bd2218e commit a3476db
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 a3476db

Please sign in to comment.