diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-06-08 15:30:15 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-06-08 15:30:15 +0300 |
commit | a9857f8c2f37668853bcc44b89d4c5e34adcf9e4 (patch) | |
tree | b5e98311ddf131b616340c00a9c88b3a4c423230 /lib/gitlab/workhorse.rb | |
parent | 3855e33cf8fe95d6de83b18698a958095fa49df5 (diff) | |
parent | c0f31845d34362b726506ecf08ceab06010dadd6 (diff) |
Add send_git_diff helper
Diffstat (limited to 'lib/gitlab/workhorse.rb')
-rw-r--r-- | lib/gitlab/workhorse.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb index 96e99dc0088..8930149b12c 100644 --- a/lib/gitlab/workhorse.rb +++ b/lib/gitlab/workhorse.rb @@ -14,7 +14,7 @@ module Gitlab [ SEND_DATA_HEADER, - "git-blob:#{encode(params)}", + "git-blob:#{encode(params)}" ] end @@ -26,7 +26,22 @@ module Gitlab [ SEND_DATA_HEADER, - "git-archive:#{encode(params)}", + "git-archive:#{encode(params)}" + ] + end + + def send_git_diff(repository, diff_refs) + from, to = diff_refs + + params = { + 'RepoPath' => repository.path_to_repo, + 'ShaFrom' => from.sha, + 'ShaTo' => to.sha + } + + [ + SEND_DATA_HEADER, + "git-diff:#{encode(params)}" ] end |