Browse Source

Use chronological commit order in default squash message (#13661) (#13696)

tags/v1.15.0-dev
Jimmy Praet 3 years ago
parent
commit
03fa2eccbc
No account linked to committer's email address
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      services/pull/pull.go

+ 3
- 2
services/pull/pull.go View File

@@ -556,7 +556,8 @@ func GetCommitMessages(pr *models.PullRequest) string {
authorsMap := map[string]bool{}
authors := make([]string, 0, list.Len())
stringBuilder := strings.Builder{}
element := list.Front()
// commits list is in reverse chronological order
element := list.Back()
for element != nil {
commit := element.Value.(*git.Commit)

@@ -581,7 +582,7 @@ func GetCommitMessages(pr *models.PullRequest) string {
authors = append(authors, authorString)
authorsMap[authorString] = true
}
element = element.Next()
element = element.Prev()
}

// Consider collecting the remaining authors

Loading…
Cancel
Save