diff --git a/branches.go b/branches.go index 88b38d53c..57ccdc039 100644 --- a/branches.go +++ b/branches.go @@ -122,7 +122,8 @@ type ProtectBranchOptions struct { // idempotent function, protecting an already protected repository branch // still returns a 200 OK status code. // -// Deprecated: This endpoint has been replaced by ProtectedBranchesService.ProtectRepositoryBranches() +// Deprecated: This endpoint has been replaced by +// ProtectedBranchesService.ProtectRepositoryBranches() // // GitLab API docs: // https://docs.gitlab.com/ee/api/branches.html#protect-repository-branch @@ -151,7 +152,8 @@ func (s *BranchesService) ProtectBranch(pid interface{}, branch string, opts *Pr // idempotent function, unprotecting an already unprotected repository branch // still returns a 200 OK status code. // -// Deprecated: This endpoint has been replaced by ProtectedBranchesService.UnprotectRepositoryBranches() +// Deprecated: This endpoint has been replaced by +// ProtectedBranchesService.UnprotectRepositoryBranches() // // GitLab API docs: // https://docs.gitlab.com/ee/api/branches.html#unprotect-repository-branch diff --git a/protected_branches.go b/protected_branches.go index 34db3dcb1..9dc919f15 100644 --- a/protected_branches.go +++ b/protected_branches.go @@ -247,6 +247,9 @@ type RequireCodeOwnerApprovalsOptions struct { // Gitlab API docs: // https://docs.gitlab.com/ee/api/protected_branches.html#update-a-protected-branch func (s *ProtectedBranchesService) RequireCodeOwnerApprovals(pid interface{}, branch string, opt *RequireCodeOwnerApprovalsOptions, options ...RequestOptionFunc) (*Response, error) { - _, req, err := s.UpdateProtectedBranch(pid, branch, &UpdateProtectedBranchOptions{CodeOwnerApprovalRequired: opt.CodeOwnerApprovalRequired}, options...) + updateOptions := &UpdateProtectedBranchOptions{ + CodeOwnerApprovalRequired: opt.CodeOwnerApprovalRequired, + } + _, req, err := s.UpdateProtectedBranch(pid, branch, updateOptions, options...) return req, err }