Method: Gitlab::Client::Branches#protect_branch
- Defined in:
- lib/gitlab/client/branches.rb
permalink #protect_branch(project, branch, options = {}) ⇒ Gitlab::ObjectifiedHash Also known as: repo_protect_branch
Protects a repository branch.
To update options, call ‘protect_branch` again with new options (i.e. `developers_can_push: false`)
51 52 53 |
# File 'lib/gitlab/client/branches.rb', line 51 def protect_branch(project, branch, = {}) post("/projects/#{url_encode project}/protected_branches", body: { name: branch }.merge()) end |