summaryrefslogtreecommitdiff
path: root/lib/api/repositories.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-06-06 13:16:30 +0200
committerDouwe Maan <douwe@selenight.nl>2016-06-06 13:16:30 +0200
commit8c3ba8d6c9021f250fb1597f6b597d817af46b38 (patch)
tree0282f6ce75ad214634839ab04cc1f111af06cd35 /lib/api/repositories.rb
parent3cb69f0c0b0049426e6abad0914812a9eef87b04 (diff)
downloadgitlab-ce-8c3ba8d6c9021f250fb1597f6b597d817af46b38.tar.gz
Add workhorse controller and API helpers
Diffstat (limited to 'lib/api/repositories.rb')
-rw-r--r--lib/api/repositories.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb
index 9cb14e95ebc..f55aceed92c 100644
--- a/lib/api/repositories.rb
+++ b/lib/api/repositories.rb
@@ -56,8 +56,7 @@ module API
blob = Gitlab::Git::Blob.find(repo, commit.id, params[:filepath])
not_found! "File" unless blob
- content_type 'text/plain'
- header(*Gitlab::Workhorse.send_git_blob(repo, blob))
+ send_git_blob repo, blob
end
# Get a raw blob contents by blob sha
@@ -80,10 +79,7 @@ module API
not_found! 'Blob' unless blob
- env['api.format'] = :txt
-
- content_type blob.mime_type
- header(*Gitlab::Workhorse.send_git_blob(repo, blob))
+ send_git_blob repo, blob
end
# Get a an archive of the repository
@@ -98,7 +94,7 @@ module API
authorize! :download_code, user_project
begin
- header(*Gitlab::Workhorse.send_git_archive(user_project, params[:sha], params[:format]))
+ send_git_archive user_project.repository, ref: params[:sha], format: params[:format]
rescue
not_found!('File')
end