diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2016-06-07 12:50:29 +0000 |
---|---|---|
committer | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2016-06-07 12:50:29 +0000 |
commit | afa21054fae2331afcf4b3784a3ffae5657b3e5b (patch) | |
tree | 935256b141573d1bedc9aa0bdd32062edc13a44e /lib | |
parent | 8c356ac5500d7f82e9afa7fa19b44aefa99edfe7 (diff) | |
parent | d47218fb9732841956a5511afbde38ff731ab106 (diff) | |
download | gitlab-ce-afa21054fae2331afcf4b3784a3ffae5657b3e5b.tar.gz |
Merge branch 'zj-workhorse-to-serve-diffs' into 'master'
14722-searching-for-usernames-should-only-be-possible-for-search-strings-with-a-valid-format
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.rb | 17 |
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 |