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 Li 2020-12-22 00:46:14 +08:00 committed by GitHub
parent 34df4e5df5
commit 09304db9a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 22 deletions

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())