Method: Gitlab::Client::Repositories#repo_archive
- Defined in:
- lib/gitlab/client/repositories.rb
#repo_archive(project, ref = 'master', format = 'tar.gz') ⇒ Gitlab::FileResponse
Get project repository archive
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/gitlab/client/repositories.rb', line 34 def repo_archive(project, ref = 'master', format = 'tar.gz') get("/projects/#{url_encode project}/repository/archive.#{format}", format: nil, headers: { Accept: 'application/octet-stream' }, query: { sha: ref }, parser: proc { |body, _| if body.encoding == Encoding::ASCII_8BIT # binary response ::Gitlab::FileResponse.new StringIO.new(body, 'rb+') else # error with json response ::Gitlab::Request.parse(body) end }) end |