2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
module API
|
|
|
|
module Helpers
|
|
|
|
module ProjectSnapshotsHelpers
|
2021-06-08 01:23:25 +05:30
|
|
|
prepend_mod_with('API::Helpers::ProjectSnapshotsHelpers') # rubocop: disable Cop/InjectEnterpriseEditionModule
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
def authorize_read_git_snapshot!
|
2020-01-01 13:55:28 +05:30
|
|
|
authenticated_with_can_read_all_resources!
|
2018-05-09 12:01:36 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def send_git_snapshot(repository)
|
|
|
|
header(*Gitlab::Workhorse.send_git_snapshot(repository))
|
2021-12-11 22:18:48 +05:30
|
|
|
|
|
|
|
body ''
|
2018-05-09 12:01:36 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def snapshot_project
|
|
|
|
user_project
|
|
|
|
end
|
|
|
|
|
|
|
|
def snapshot_repository
|
|
|
|
if to_boolean(params[:wiki])
|
|
|
|
snapshot_project.wiki.repository
|
|
|
|
else
|
|
|
|
snapshot_project.repository
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|