mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-19 17:01:12 +00:00
fix: CreateDeclarativeRepo should allow merging PRs when PRs are enabled
This commit is contained in:
parent
0b552407fe
commit
fa5011b988
1 changed files with 19 additions and 0 deletions
|
@ -495,6 +495,25 @@ func CreateDeclarativeRepo(t *testing.T, owner *user_model.User, name string, en
|
|||
}
|
||||
if enabledUnits != nil {
|
||||
opts.EnabledUnits = optional.Some(enabledUnits)
|
||||
|
||||
for _, unitType := range enabledUnits {
|
||||
if unitType == unit_model.TypePullRequests {
|
||||
opts.UnitConfig = optional.Some(map[unit_model.Type]convert.Conversion{
|
||||
unit_model.TypePullRequests: &repo_model.PullRequestsConfig{
|
||||
AllowMerge: true,
|
||||
AllowRebase: true,
|
||||
AllowRebaseMerge: true,
|
||||
AllowSquash: true,
|
||||
AllowFastForwardOnly: true,
|
||||
AllowManualMerge: true,
|
||||
AllowRebaseUpdate: true,
|
||||
DefaultMergeStyle: repo_model.MergeStyleMerge,
|
||||
DefaultUpdateStyle: repo_model.UpdateStyleMerge,
|
||||
},
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if disabledUnits != nil {
|
||||
opts.DisabledUnits = optional.Some(disabledUnits)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue