diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-05-12 20:50:49 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-03 18:43:22 +0200 |
commit | 01e1139f68066e46b86ef92749513377eee63f5b (patch) | |
tree | b5ca525894fa2c548dce2b357f0b5419ee719388 /lib | |
parent | ca3c5c295ed653b483fe81c3918ffe60f46666b9 (diff) | |
download | gitlab-ce-01e1139f68066e46b86ef92749513377eee63f5b.tar.gz |
Workhorse to serve raw diffs
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 |