diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-06-08 14:30:15 +0200 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-06-08 14:30:15 +0200 |
commit | a9857f8c2f37668853bcc44b89d4c5e34adcf9e4 (patch) | |
tree | b5e98311ddf131b616340c00a9c88b3a4c423230 /app/helpers/workhorse_helper.rb | |
parent | 3855e33cf8fe95d6de83b18698a958095fa49df5 (diff) | |
parent | c0f31845d34362b726506ecf08ceab06010dadd6 (diff) | |
download | gitlab-ce-a9857f8c2f37668853bcc44b89d4c5e34adcf9e4.tar.gz |
Add send_git_diff helper
Diffstat (limited to 'app/helpers/workhorse_helper.rb')
-rw-r--r-- | app/helpers/workhorse_helper.rb | 9 |
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)) |