Skip to content

Commit 70eb2f0

Browse files
committed
Make the API work
1 parent ffddf43 commit 70eb2f0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

routers/api/v1/repo/branch.go

+5
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ func CreateBranchProtection(ctx *context.APIContext) {
642642
ProtectedFilePatterns: form.ProtectedFilePatterns,
643643
UnprotectedFilePatterns: form.UnprotectedFilePatterns,
644644
BlockOnOutdatedBranch: form.BlockOnOutdatedBranch,
645+
BlockAdminMergeOverride: form.BlockAdminMergeOverride,
645646
}
646647

647648
err = git_model.UpdateProtectBranch(ctx, ctx.Repo.Repository, protectBranch, git_model.WhitelistOptions{
@@ -852,6 +853,10 @@ func EditBranchProtection(ctx *context.APIContext) {
852853
protectBranch.BlockOnOutdatedBranch = *form.BlockOnOutdatedBranch
853854
}
854855

856+
if form.BlockAdminMergeOverride != nil {
857+
protectBranch.BlockAdminMergeOverride = *form.BlockAdminMergeOverride
858+
}
859+
855860
var whitelistUsers, forcePushAllowlistUsers, mergeWhitelistUsers, approvalsWhitelistUsers []int64
856861
if form.PushWhitelistUsernames != nil {
857862
whitelistUsers, err = user_model.GetUserIDsByNames(ctx, form.PushWhitelistUsernames, false)

0 commit comments

Comments
 (0)