From 0b1b9c409d3adbf4517351dbb9037ed053f73e67 Mon Sep 17 00:00:00 2001 From: James Ramsay Date: Mon, 19 Feb 2018 15:41:04 -0500 Subject: Add option to suppress archive commit sha Repository archives are always named `--` even if the ref is a commit. A consequence of always including the sha even for tags is that packaging a release is more difficult because both the ref and sha must be known by the packager. - add append_sha option (defaults true) to provide a method for toggling this feature. Support added to GitLab Workhorse by gitlab-org/gitlab-workhorse!232 --- lib/api/repositories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/repositories.rb') diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb index 9638c53a1df..2396dc73f0e 100644 --- a/lib/api/repositories.rb +++ b/lib/api/repositories.rb @@ -88,7 +88,7 @@ module API end get ':id/repository/archive', requirements: { format: Gitlab::PathRegex.archive_formats_regex } do begin - send_git_archive user_project.repository, ref: params[:sha], format: params[:format] + send_git_archive user_project.repository, ref: params[:sha], format: params[:format], append_sha: true rescue not_found!('File') end -- cgit v1.2.3