summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Vosmaer (GitLab) <jacob@gitlab.com>2016-06-07 12:50:29 +0000
committerJacob Vosmaer (GitLab) <jacob@gitlab.com>2016-06-07 12:50:29 +0000
commitafa21054fae2331afcf4b3784a3ffae5657b3e5b (patch)
tree935256b141573d1bedc9aa0bdd32062edc13a44e /lib
parent8c356ac5500d7f82e9afa7fa19b44aefa99edfe7 (diff)
parentd47218fb9732841956a5511afbde38ff731ab106 (diff)
downloadgitlab-ce-afa21054fae2331afcf4b3784a3ffae5657b3e5b.tar.gz
Workhorse to serve raw diffs Fixes (partially) #13999 Dependent on: gitlab-org/gitlab-workhorse!45 See merge request !4130
Diffstat (limited to 'lib')
-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