File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -517,6 +517,8 @@ func CloseRepoBranchesPulls(doer *models.User, repo *models.Repository) error {
517
517
return nil
518
518
}
519
519
520
+ var commitMessageTrailersPattern = regexp .MustCompile (`(^|.*\n\n)([\w-]+: [^\n]+)(\n[\w-]+: [^\n]+)*$` )
521
+
520
522
// GetSquashMergeCommitMessages returns the commit messages between head and merge base (if there is one)
521
523
func GetSquashMergeCommitMessages (pr * models.PullRequest ) string {
522
524
if err := pr .LoadIssue (); err != nil {
@@ -574,7 +576,6 @@ func GetSquashMergeCommitMessages(pr *models.PullRequest) string {
574
576
stringBuilder .WriteString (pr .Issue .Content )
575
577
if stringBuilder .Len () > 0 {
576
578
stringBuilder .WriteRune ('\n' )
577
- commitMessageTrailersPattern := regexp .MustCompile (`(^|.*\n\n)([\w-]+: [^\n]+)(\n[\w-]+: [^\n]+)*$` )
578
579
if ! commitMessageTrailersPattern .MatchString (pr .Issue .Content ) {
579
580
stringBuilder .WriteRune ('\n' )
580
581
}
You can’t perform that action at this time.
0 commit comments