0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-06-02 14:39:17 +02:00
gitea/services
Nicolas f5d0e1633d
fix(pull): preserve squash message trailers and additional commit messages
When a PR description already ends with git trailers (e.g. Issue: X,
Signed-off-by:), the co-author separator line (---------)  was still
inserted before the Co-authored-by lines, breaking the trailer block.
messageHasTrailers now skips the separator so co-authors are appended
directly into the existing trailer block.

In PR-description mode (PopulateSquashCommentWithCommitMessages=false),
commit messages beyond the oldest were silently dropped. They are now
appended as bullet points after the PR description, consistent with the
commit-message mode format.

The commit-message loop is extracted into formatSquashMergeCommitMessages.
Callers that want to skip the oldest commit pass a trimmed slice
(commits[:max(0, len(commits)-1)]) instead of a skipFirst bool flag.

Co-Authored-By: Nicolas <nicolas@bircks.eu>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 12:12:36 +02:00
..
2026-05-31 03:33:13 +00:00