Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-25 17:22:08 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-25 17:22:08 +0400
commiteaeb4a90d431ff5e1e6156c10f3118f70c3c4f8e (patch)
tree3d70b6de4c1192aafdbb1f4ebd12d7b4b905f8ba /lib/api/branches.rb
parent66ef5c1aa2f50b93ad654dc3b8d9f3a0f5c8bc1b (diff)
Fix branch API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api/branches.rb')
-rw-r--r--lib/api/branches.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb
index 75783628e3d..14f8b20f6b2 100644
--- a/lib/api/branches.rb
+++ b/lib/api/branches.rb
@@ -14,7 +14,7 @@ module API
# Example Request:
# GET /projects/:id/repository/branches
get ":id/repository/branches" do
- present user_project.repo.heads.sort_by(&:name), with: Entities::RepoObject, project: user_project
+ present user_project.repository.branches.sort_by(&:name), with: Entities::RepoObject, project: user_project
end
# Get a single branch
@@ -25,7 +25,7 @@ module API
# Example Request:
# GET /projects/:id/repository/branches/:branch
get ':id/repository/branches/:branch', requirements: { branch: /.*/ } do
- @branch = user_project.repo.heads.find { |item| item.name == params[:branch] }
+ @branch = user_project.repository.branches.find { |item| item.name == params[:branch] }
not_found!("Branch does not exist") if @branch.nil?
present @branch, with: Entities::RepoObject, project: user_project
end