Module: Gitlab::Client::Branches
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/branches.rb
Overview
Defines methods related to repositories.
Instance Method Summary collapse
-
#branch(project, branch) ⇒ Gitlab::ObjectifiedHash
(also: #repo_branch)
Gets information about a repository branch.
-
#branches(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
(also: #repo_branches)
Gets a list of project repositiory branches.
-
#create_branch(project, branch, ref) ⇒ Gitlab::ObjectifiedHash
(also: #repo_create_branch)
Creates a repository branch.
-
#protect_branch(project, branch) ⇒ Gitlab::ObjectifiedHash
(also: #repo_protect_branch)
Protects a repository branch.
-
#unprotect_branch(project, branch) ⇒ Gitlab::ObjectifiedHash
(also: #repo_unprotect_branch)
Unprotects a repository branch.
Instance Method Details
#branch(project, branch) ⇒ Gitlab::ObjectifiedHash Also known as: repo_branch
Gets information about a repository branch.
28 29 30 |
# File 'lib/gitlab/client/branches.rb', line 28 def branch(project, branch) get("/projects/#{project}/repository/branches/#{branch}") end |
#branches(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash> Also known as: repo_branches
Gets a list of project repositiory branches.
14 15 16 |
# File 'lib/gitlab/client/branches.rb', line 14 def branches(project, ={}) get("/projects/#{project}/repository/branches", :query => ) end |
#create_branch(project, branch, ref) ⇒ Gitlab::ObjectifiedHash Also known as: repo_create_branch
Creates a repository branch. Requires Gitlab >= 6.8.x
72 73 74 |
# File 'lib/gitlab/client/branches.rb', line 72 def create_branch(project, branch, ref) post("/projects/#{project}/repository/branches",:body => {:branch_name => branch, :ref => ref}) end |
#protect_branch(project, branch) ⇒ Gitlab::ObjectifiedHash Also known as: repo_protect_branch
Protects a repository branch.
43 44 45 |
# File 'lib/gitlab/client/branches.rb', line 43 def protect_branch(project, branch) put("/projects/#{project}/repository/branches/#{branch}/protect") end |
#unprotect_branch(project, branch) ⇒ Gitlab::ObjectifiedHash Also known as: repo_unprotect_branch
Unprotects a repository branch.
57 58 59 |
# File 'lib/gitlab/client/branches.rb', line 57 def unprotect_branch(project, branch) put("/projects/#{project}/repository/branches/#{branch}/unprotect") end |