From eaeb4a90d431ff5e1e6156c10f3118f70c3c4f8e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 25 Sep 2014 16:22:08 +0300 Subject: Fix branch API Signed-off-by: Dmitriy Zaporozhets --- lib/api/branches.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/api') 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 -- cgit v1.2.1