summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@ksz-bcss.fgov.be>2020-11-25 21:08:17 +0100
committerGitHub <noreply@github.com>2020-11-25 15:08:17 -0500
commit03fa2eccbc6dcdaa08497201113af5f6c2ff6e6b (patch)
tree7b5ff3da543748d757ec19b797a53e39dc122c94
parent57fa9b0f25e4aa45bd813b1bffedb7ba3c929942 (diff)
downloadgitea-03fa2eccbc6dcdaa08497201113af5f6c2ff6e6b.tar.gz
gitea-03fa2eccbc6dcdaa08497201113af5f6c2ff6e6b.zip
Use chronological commit order in default squash message (#13661) (#13696)
-rw-r--r--services/pull/pull.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/pull/pull.go b/services/pull/pull.go
index 61af7fe9a5..0bfcd8a63b 100644
--- a/services/pull/pull.go
+++ b/services/pull/pull.go
@@ -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