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.
-
#delete_branch(project, branch) ⇒ Gitlab::ObjectifiedHash
(also: #repo_delete_branch)
Deletes 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.
29 30 31 |
# File 'lib/gitlab/client/branches.rb', line 29 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.
15 16 17 |
# File 'lib/gitlab/client/branches.rb', line 15 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
73 74 75 |
# File 'lib/gitlab/client/branches.rb', line 73 def create_branch(project, branch, ref) post("/projects/#{project}/repository/branches",:body => {:branch_name => branch, :ref => ref}) end |
#delete_branch(project, branch) ⇒ Gitlab::ObjectifiedHash Also known as: repo_delete_branch
Deletes a repository branch. Requires Gitlab >= 6.8.x
87 88 89 |
# File 'lib/gitlab/client/branches.rb', line 87 def delete_branch(project, branch) delete("/projects/#{project}/repository/branches/#{branch}") end |
#protect_branch(project, branch) ⇒ Gitlab::ObjectifiedHash Also known as: repo_protect_branch
Protects a repository branch.
44 45 46 |
# File 'lib/gitlab/client/branches.rb', line 44 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.
58 59 60 |
# File 'lib/gitlab/client/branches.rb', line 58 def unprotect_branch(project, branch) put("/projects/#{project}/repository/branches/#{branch}/unprotect") end |