summaryrefslogtreecommitdiff
path: root/app/helpers/workhorse_helper.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-06-08 14:30:15 +0200
committerDouwe Maan <douwe@selenight.nl>2016-06-08 14:30:15 +0200
commita9857f8c2f37668853bcc44b89d4c5e34adcf9e4 (patch)
treeb5e98311ddf131b616340c00a9c88b3a4c423230 /app/helpers/workhorse_helper.rb
parent3855e33cf8fe95d6de83b18698a958095fa49df5 (diff)
parentc0f31845d34362b726506ecf08ceab06010dadd6 (diff)
downloadgitlab-ce-a9857f8c2f37668853bcc44b89d4c5e34adcf9e4.tar.gz
Add send_git_diff helper
Diffstat (limited to 'app/helpers/workhorse_helper.rb')
-rw-r--r--app/helpers/workhorse_helper.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/helpers/workhorse_helper.rb b/app/helpers/workhorse_helper.rb
index 9d306c9096e..2bd0dbfd095 100644
--- a/app/helpers/workhorse_helper.rb
+++ b/app/helpers/workhorse_helper.rb
@@ -1,4 +1,4 @@
-# Helpers to send Git blobs or archives through Workhorse.
+# Helpers to send Git blobs, diffs or archives through Workhorse.
# Workhorse will also serve files when using `send_file`.
module WorkhorseHelper
# Send a Git blob through Workhorse
@@ -9,6 +9,13 @@ module WorkhorseHelper
head :ok # 'render nothing: true' messes up the Content-Type
end
+ # Send a Git diff through Workhorse
+ def send_git_diff(repository, diff_refs)
+ headers.store(*Gitlab::Workhorse.send_git_diff(repository, diff_refs))
+ headers['Content-Disposition'] = 'inline'
+ head :ok
+ end
+
# Archive a Git repository and send it through Workhorse
def send_git_archive(repository, ref:, format:)
headers.store(*Gitlab::Workhorse.send_git_archive(repository, ref: ref, format: format))