diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-06-14 09:06:53 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-06-14 09:06:53 +0530 |
commit | d0bcba1105686c2306414a402bf33c85a08a17a6 (patch) | |
tree | 2922086316008cf86e864e1dd8a251fd4878cb04 /lib/api/helpers.rb | |
parent | d754d99179f1ffe846fcc1d8e858163b39efc5dc (diff) | |
parent | f34af6b83cc2663bb8a076f4df9c82047e5511ab (diff) | |
download | gitlab-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.rb | 18 |
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 |