Use the text of pull-request as the squash commit's message (#13071)

Originally, it was filled by the commit messages of the involved
commits. In this change, we use the headline comment of the pull
request as the commit message when it is a squash merge.

Thanks to @zeripath for suggesting the idea.

Fixes #12365

Co-authored-by: Mura Li <typeless@users.noreply.github.com>
This commit is contained in:
Mura LiandMura Li authored and GitHub committed 2020-12-21 17:46:14 +01:00
1 parent 34df4e5df5
commit 09304db9a5
2 files changed
+10 -22

No files matched your search

+1 -1
View File
@@ -440,7 +440,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare
ctx.ServerError("IsUserAllowedToUpdate", err)
return nil
}
ctx.Data["GetCommitMessages"] = pull_service.GetCommitMessages(pull)
ctx.Data["GetCommitMessages"] = pull_service.GetSquashMergeCommitMessages(pull)
}
sha, err := baseGitRepo.GetRefCommitID(pull.GetGitRefName())