MCPcopy Create free account
hub / github.com/devopsctl/gitlabctl / protectBranch

Function protectBranch

cmd/edit_branch.go:88–98  ·  view source on GitHub ↗
(branch, project string, opts *gitlab.ProtectBranchOptions)

Source from the content-addressed store, hash-verified

86}
87
88func protectBranch(branch, project string, opts *gitlab.ProtectBranchOptions) (*gitlab.Branch, error) {
89 git, err := newGitlabClient()
90 if err != nil {
91 return nil, err
92 }
93 protectedBranch, _, err := git.Branches.ProtectBranch(project, branch, opts)
94 if err != nil {
95 return nil, err
96 }
97 return protectedBranch, nil
98}
99
100func runUnProtectBranch(branch, project, out string) error {
101 branchInfo, err := unProtectBranch(branch, project)

Callers 1

runProtectBranchFunction · 0.85

Calls 1

newGitlabClientFunction · 0.85

Tested by

no test coverage detected