module Gitlab::Client::Branches

def protect_branch(project, branch, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - Details about the branch

Options Hash: (**options)
  • :developers_can_merge (Boolean) -- True to allow developers to merge into the branch (default = false)
  • :developers_can_push (Boolean) -- True to allow developers to push to the branch (default = false)

Parameters:
  • options (Hash) -- A customizable set of options.
  • branch (String) -- The name of the branch.
  • project (Integer, String) -- The ID or name of a project.
def protect_branch(project, branch, options = {})
  post("/projects/#{url_encode project}/protected_branches", body: { name: branch }.merge(options))
end