Method: Gitlab::Client::Branches#protected_branch

Defined in:
lib/gitlab/client/branches.rb

#protected_branch(project, branch) ⇒ Gitlab::ObjectifiedHash Also known as: repo_protected_branch

Gets a single protected branch or wildcard protected branch

Examples:

Gitlab.protected_branch(3, 'api')

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • name (String)

    The name of the branch or wildcard

Returns:


130
131
132
# File 'lib/gitlab/client/branches.rb', line 130

def protected_branch(project, branch)
  get("/projects/#{url_encode project}/protected_branches/#{url_encode branch}")
end