Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-05-12 21:50:49 +0300
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-06-03 19:43:22 +0300
commit01e1139f68066e46b86ef92749513377eee63f5b (patch)
treeb5ca525894fa2c548dce2b357f0b5419ee719388 /lib/gitlab/workhorse.rb
parentca3c5c295ed653b483fe81c3918ffe60f46666b9 (diff)
Workhorse to serve raw diffs
Diffstat (limited to 'lib/gitlab/workhorse.rb')
-rw-r--r--lib/gitlab/workhorse.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb
index c3ddd4c2680..7f6ef71b303 100644
--- a/lib/gitlab/workhorse.rb
+++ b/lib/gitlab/workhorse.rb
@@ -29,9 +29,22 @@ module Gitlab
"git-archive:#{encode(params)}",
]
end
-
+
+ def send_git_diff(repository, from, to)
+ params = {
+ 'RepoPath' => repository.path_to_repo,
+ 'ShaFrom' => from,
+ 'ShaTo' => to
+ }
+
+ [
+ SEND_DATA_HEADER,
+ "git-diff:#{encode(params)}"
+ ]
+ end
+
protected
-
+
def encode(hash)
Base64.urlsafe_encode64(JSON.dump(hash))
end