summaryrefslogtreecommitdiff
path: root/lib/gitlab/workhorse.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 /lib/gitlab/workhorse.rb
parent3855e33cf8fe95d6de83b18698a958095fa49df5 (diff)
parentc0f31845d34362b726506ecf08ceab06010dadd6 (diff)
downloadgitlab-ce-a9857f8c2f37668853bcc44b89d4c5e34adcf9e4.tar.gz
Add send_git_diff helper
Diffstat (limited to 'lib/gitlab/workhorse.rb')
-rw-r--r--lib/gitlab/workhorse.rb19
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