From 8c3ba8d6c9021f250fb1597f6b597d817af46b38 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 6 Jun 2016 13:16:30 +0200 Subject: Add workhorse controller and API helpers --- lib/api/helpers.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/api/helpers.rb') 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 -- cgit v1.2.1 From 701e2df7e55113dafd48c570baad44bf7f24f863 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 10 Jun 2016 12:29:15 +0200 Subject: Satisfy Rubocop --- lib/api/helpers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/api/helpers.rb') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 0e47bb0b8ad..e1d3bbcc02d 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -412,11 +412,11 @@ module API def send_git_blob(repository, blob) env['api.format'] = :txt content_type 'text/plain' - header *Gitlab::Workhorse.send_git_blob(repository, blob) + 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) + header(*Gitlab::Workhorse.send_git_archive(repository, ref: ref, format: format)) end end end -- cgit v1.2.1 From a85dde9182f177cc2fdabd90ccdad870bf4d84c3 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 11 Jun 2016 07:16:32 -0700 Subject: Fix Error 500 when using closes_issues API with an external issue tracker Closes #18484 --- lib/api/helpers.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/api/helpers.rb') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index e1d3bbcc02d..de5959e3aae 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -418,5 +418,13 @@ module API 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 -- cgit v1.2.1