diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-12 09:24:54 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-12 09:24:54 -0800 |
commit | 8f9c01feed31c8a87bfbaf89727cd6626ca73db9 (patch) | |
tree | ee414c88d8ba42af7a3507dc62f0f09fcbc895d1 /lib | |
parent | 452adb7bccbe7d794aa6a5d4ea9a765020db1c7c (diff) | |
parent | 2bd955961cdb6d0fa7e51e8fbb61581d6b101b05 (diff) | |
download | gitlab-ce-8f9c01feed31c8a87bfbaf89727cd6626ca73db9.tar.gz |
Merge pull request #2946 from Asquera/fix/access_to_non_existent_branch
API: Fixes return code when accessing non existent branch (#2922)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index a16243aa822..d416121a78a 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -230,6 +230,7 @@ module Gitlab # GET /projects/:id/repository/branches/:branch get ":id/repository/branches/:branch" do @branch = user_project.repo.heads.find { |item| item.name == params[:branch] } + not_found!("Branch does not exist") if @branch.nil? present @branch, with: Entities::RepoObject, project: user_project end |