summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-06-14 09:06:53 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-06-14 09:06:53 +0530
commitd0bcba1105686c2306414a402bf33c85a08a17a6 (patch)
tree2922086316008cf86e864e1dd8a251fd4878cb04 /lib/api/helpers.rb
parentd754d99179f1ffe846fcc1d8e858163b39efc5dc (diff)
parentf34af6b83cc2663bb8a076f4df9c82047e5511ab (diff)
downloadgitlab-ce-d0bcba1105686c2306414a402bf33c85a08a17a6.tar.gz
Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index a179fe9f2f9..8c4a707e7ee 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -420,5 +420,23 @@ 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
+
+ def issue_entity(project)
+ if project.has_external_issue_tracker?
+ Entities::ExternalIssue
+ else
+ Entities::Issue
+ end
+ end
end
end