diff options
author | Nick Thomas <nick@gitlab.com> | 2018-04-03 20:57:55 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-04-19 19:25:01 +0300 |
commit | 672733aa66e371edc50f6d1c2467896c40ed9ac8 (patch) | |
tree | f7d5313ab03c496c74ca63a29f786d9db19f79b1 /lib/gitlab/workhorse.rb | |
parent | fb46dfb235f452333984891af5bb677f90faf174 (diff) |
Add an API endpoint to download git repository snapshots
Diffstat (limited to 'lib/gitlab/workhorse.rb')
-rw-r--r-- | lib/gitlab/workhorse.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb index 153cb2a8bb1..1f060de657d 100644 --- a/lib/gitlab/workhorse.rb +++ b/lib/gitlab/workhorse.rb @@ -81,6 +81,20 @@ module Gitlab ] end + def send_git_snapshot(repository) + params = { + 'GitalyServer' => gitaly_server_hash(repository), + 'GetSnapshotRequest' => Gitaly::GetSnapshotRequest.new( + repository: repository.gitaly_repository + ).to_json + } + + [ + SEND_DATA_HEADER, + "git-snapshot:#{encode(params)}" + ] + end + def send_git_diff(repository, diff_refs) params = if Gitlab::GitalyClient.feature_enabled?(:workhorse_send_git_diff, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) { |