Skip to content

Commit

Permalink
Few minor tweaks…
Browse files Browse the repository at this point in the history
  • Loading branch information
svanharmelen committed Feb 3, 2023
1 parent f90d379 commit 1b76c1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions branches.go
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion protected_branches.go
Expand Up @@ -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
}

0 comments on commit 1b76c1c

Please sign in to comment.