module Gitlab::Client::Repositories
def repo_archive(project, ref = 'master', format = 'tar.gz')
-
(Gitlab::FileResponse)
-
Parameters:
-
format
(String
) -- The archive format. Options are: tar.gz (default), tar.bz2, tbz, tbz2, tb2, bz2, tar, and zip -
ref
(String
) -- The commit sha, branch, or tag to download. -
project
(Integer, String
) -- The ID or name of a project.
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