summaryrefslogtreecommitdiff
path: root/lib/api/helpers.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/helpers.rb
parent3cb69f0c0b0049426e6abad0914812a9eef87b04 (diff)
downloadgitlab-ce-8c3ba8d6c9021f250fb1597f6b597d817af46b38.tar.gz
Add workhorse controller and API helpers
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..0e47bb0b8ad 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