mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-02-06 18:00:29 +00:00
Fixes #2691 This is changing the trimming of the merge message template to allow first empty line to be considered as empty message (also referred as title in frontend). 2 unit tests were added to check for proper behavior and possible edge case (simple template with only 2 lines, not trimming needed). Also a former unit test with 3 empty lines at the beginning of the template was changed. The behavior with this patch is: * splitting first `\n` to separate message from body * trim remaining `\n` from body if `\n` was present or take template as is as message (no trim necessary as no `\n` is present in the template) As this is an old issue the expected behavior might have changed from when the issue was triaged. I additionally manually testes on the next.forgejo.org and locally built binary from this branch, I am attaching both screenshot of final result. The test PR can be seen at [https://v13.next.forgejo.org/kajika/merge_template_issue_2691/pulls/1](https://v13.next.forgejo.org/kajika/merge_template_issue_2691/pulls/1) and, in case the next repository is deletate the content of `.forgejo/default_merge_message/MERGE_TEMPLATE.md` is (first line is empty): ``` This is the description of the merge from "${HeadBranch}" to "${BaseBranch}" ``` Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9930 Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Corentin <corentin@ayo.tokyo> Co-committed-by: Corentin <corentin@ayo.tokyo> |
||
|---|---|---|
| .. | ||
| check.go | ||
| check_test.go | ||
| comment.go | ||
| commit_status.go | ||
| commit_status_test.go | ||
| edits.go | ||
| lfs.go | ||
| main_test.go | ||
| merge.go | ||
| merge_ff_only.go | ||
| merge_manual.go | ||
| merge_merge.go | ||
| merge_prepare.go | ||
| merge_rebase.go | ||
| merge_squash.go | ||
| merge_test.go | ||
| patch.go | ||
| patch_test.go | ||
| patch_unmerged.go | ||
| pull.go | ||
| pull_test.go | ||
| review.go | ||
| review_test.go | ||
| temp_repo.go | ||
| update.go | ||
| update_rebase.go | ||