mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-22 20:53:40 +09:00
fix(pulls): add branch-name option for DEFAULT_TITLE_SOURCE (#38356)
Adds a new `branch-name` value for the `[repository.pull-request]` `DEFAULT_TITLE_SOURCE` setting that always uses the normalized branch name as the PR title, regardless of commit count. Fix #38317 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -70,6 +70,10 @@ func TestNewPullRequestTitleContent(t *testing.T) {
|
||||
assert.Equal(t, "Head branch", title)
|
||||
assert.Empty(t, content)
|
||||
|
||||
title, content = prepareNewPullRequestTitleContent(ci, nil, setting.RepoPRTitleSourceBranchName)
|
||||
assert.Equal(t, "head-branch", title)
|
||||
assert.Empty(t, content)
|
||||
|
||||
// single commit
|
||||
title, content = prepareNewPullRequestTitleContent(ci, []*git_model.SignCommitWithStatuses{mockCommit("single-commit-title\nbody")}, setting.RepoPRTitleSourceAuto)
|
||||
assert.Equal(t, "single-commit-title", title)
|
||||
|
||||
Reference in New Issue
Block a user