module Gitlab::Client::Branch
Overview
Defines methods related to branch.
See http://docs.gitlab.com/ce/api/branches.html
Direct including types
Defined in:
gitlab/client/branch.crInstance Method Summary
-
#branch(project_id : Int32, branch : String) : JSON::Any
Get single branch in a project.
-
#branches(project_id : Int32, params : Hash | Nil = nil) : JSON::Any
Gets a list of branches in a project.
-
#create_branch(project_id : Int32, branch : String, ref : String) : JSON::Any
Create branch in a project.
-
#delete_branch(project_id : Int32, branch : String) : JSON::Any
Delete a branch.
-
#protect_branch(project_id : Int32, branch : String, form : Hash | Nil = nil) : JSON::Any
Protect branch in a project.
-
#unprotect_branch(project_id : Int32, branch : String) : JSON::Any
Unprotect branch in a project.
Instance Method Detail
def branch(project_id : Int32, branch : String) : JSON::Any
#
Get single branch in a project.
- param [Int32] project_id The ID of a project.
- param [String] branch The name of a branch.
- return [JSON::Any] Information about the branch in a project.
client.branch(1, "master")
def branches(project_id : Int32, params : Hash | Nil = nil) : JSON::Any
#
Gets a list of branches in a project.
- param [Int32] project_id The ID of a project.
- param [Hash] params A customizable set of params.
- option params [String] :page The page number.
- option params [String] :per_page The number of results per page. default is 20
- return [JSON::Any] List of branches under a project.
client.branches(1)
client.branches(1, {"per_page" => "10"})
def create_branch(project_id : Int32, branch : String, ref : String) : JSON::Any
#
Create branch in a project.
- param [Int32] project_id The ID of a project.
- param [String] branch The name of a branch.
- param [String] ref The branch name or commit SHA to create branch from.
- return [JSON::Any] Information about the created branch in a project.
client.create_branch(1, "develop", "master")
client.create_branch(1, "hotfix/xxx", "9dff773")
def delete_branch(project_id : Int32, branch : String) : JSON::Any
#
Delete a branch.
- param [Int32] project_id The ID of a project
- param [String] branch The name of a branch.
- return [JSON::Any] Information about the deleted branch.
client.delete_branch(4, 2)
def protect_branch(project_id : Int32, branch : String, form : Hash | Nil = nil) : JSON::Any
#
Protect branch in a project.
- param [Int32] project_id The ID of a project.
- param [String] branch The name of a branch.
- param [String] ref The branch name or commit SHA to create branch from.
- return [JSON::Any] Information about protected branch in a project
client.branch(1, "master")
client.protect_branch(5, 'api', { "developers_can_push" => "true" })
def unprotect_branch(project_id : Int32, branch : String) : JSON::Any
#
Unprotect branch in a project.
- param [Int32] project_id The ID of a project.
- param [String] branch The name of a branch.
- return [JSON::Any] Information about unprotected branch in a project
client.branch(1, "master")