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 <wxiaoguang@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
  • Loading branch information
3 people authored and Sysoev, Vladimir committed Aug 10, 2022
1 parent 2a083da commit b2fa458
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 @@ -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,
},
{
Expand Down

0 comments on commit b2fa458

Please sign in to comment.