summaryrefslogtreecommitdiff
path: root/lib/gitlab/workhorse.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/workhorse.rb')
-rw-r--r--lib/gitlab/workhorse.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb
new file mode 100644
index 00000000000..ff6fbf0b5c1
--- /dev/null
+++ b/lib/gitlab/workhorse.rb
@@ -0,0 +1,21 @@
+require 'base64'
+require 'json'
+
+module Gitlab
+ class Workhorse
+ class << self
+ def send_git_blob(repository, blob)
+ params_hash = {
+ 'RepoPath' => repository.path_to_repo,
+ 'BlobId' => blob.id,
+ }
+ params = Base64.urlsafe_encode64(JSON.dump(params_hash))
+
+ [
+ 'Gitlab-Workhorse-Send-Data',
+ "git-blob:#{params}",
+ ]
+ end
+ end
+ end
+end \ No newline at end of file