summaryrefslogtreecommitdiff
path: root/lib/api/files.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-27 13:01:57 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-27 13:01:57 -0800
commit0d22b75b03496ced3d783f8fee9584098602ea1c (patch)
treec7ddec6072c716fd63a8703f2dfeb0e4234a633f /lib/api/files.rb
parent5f682094d9b7c985ad62ebe29664bb6fe87b54be (diff)
parentd4aab6528cb80b0f41bdac2240dd9cc32543481d (diff)
downloadgitlab-ce-0d22b75b03496ced3d783f8fee9584098602ea1c.tar.gz
Merge branch 'master' into mmonaco/gitlab-ce-api-user-noconfirm
Conflicts: lib/api/users.rb
Diffstat (limited to 'lib/api/files.rb')
-rw-r--r--lib/api/files.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/api/files.rb b/lib/api/files.rb
index 84e1d311781..3176ef0e256 100644
--- a/lib/api/files.rb
+++ b/lib/api/files.rb
@@ -35,7 +35,7 @@ module API
file_path = attrs.delete(:file_path)
commit = user_project.repository.commit(ref)
- not_found! "Commit" unless commit
+ not_found! 'Commit' unless commit
blob = user_project.repository.blob_at(commit.sha, file_path)
@@ -53,7 +53,7 @@ module API
commit_id: commit.id,
}
else
- render_api_error!('File not found', 404)
+ not_found! 'File'
end
end
@@ -117,7 +117,8 @@ module API
branch_name: branch_name
}
else
- render_api_error!(result[:message], 400)
+ http_status = result[:http_status] || 400
+ render_api_error!(result[:message], http_status)
end
end