summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-10 22:06:30 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-10 22:06:30 +0200
commitd5fac1ced3daa33a7275aff9a4be88a741ee78c9 (patch)
tree06c308909f91d19de4c35946a678cb56b055f8e9 /lib/api/helpers.rb
parent2fd009d23810939a77ddc1716ab4250ee18826fa (diff)
parentb4e84809e8170a43126507da0bc6a3b94c33804b (diff)
downloadgitlab-ce-d5fac1ced3daa33a7275aff9a4be88a741ee78c9.tar.gz
Merge remote-tracking branch 'origin/master' into retry-spinach-tests
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 2aaa0557ea3..e1d3bbcc02d 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -408,5 +408,15 @@ module API
error!(errors[:access_level], 422) if errors[:access_level].any?
not_found!(errors)
end
+
+ def send_git_blob(repository, blob)
+ env['api.format'] = :txt
+ content_type 'text/plain'
+ header(*Gitlab::Workhorse.send_git_blob(repository, blob))
+ end
+
+ def send_git_archive(repository, ref:, format:)
+ header(*Gitlab::Workhorse.send_git_archive(repository, ref: ref, format: format))
+ end
end
end