From d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 20 Oct 2021 08:43:02 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-4-stable-ee --- lib/api/repositories.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/api/repositories.rb') diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb index 3c9255e3117..1aa76906b3d 100644 --- a/lib/api/repositories.rb +++ b/lib/api/repositories.rb @@ -101,6 +101,7 @@ module API params do optional :sha, type: String, desc: 'The commit sha of the archive to be downloaded' optional :format, type: String, desc: 'The archive format' + optional :path, type: String, desc: 'Subfolder of the repository to be downloaded' end get ':id/repository/archive', requirements: { format: Gitlab::PathRegex.archive_formats_regex } do if archive_rate_limit_reached?(current_user, user_project) @@ -109,7 +110,7 @@ module API not_acceptable! if Gitlab::HotlinkingDetector.intercept_hotlinking?(request) - send_git_archive user_project.repository, ref: params[:sha], format: params[:format], append_sha: true + send_git_archive user_project.repository, ref: params[:sha], format: params[:format], append_sha: true, path: params[:path] rescue StandardError not_found!('File') end -- cgit v1.2.3