Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-04-11 13:01:52 +0300
committerRémy Coutable <remy@rymai.me>2019-04-11 13:01:52 +0300
commit51119395e668d592d69266cf74dcb67b667082a8 (patch)
tree4fb43693d7022077cc54abe24ab94918ac1c8963 /lib/gitlab/git
parent79b0bf2a9fa226e5b1b03252bf28e41f2cb7f184 (diff)
parent171818df0a72097aa1a804c8213666b3f66b0966 (diff)
Merge branch 'revert-24704-download-repository-path' into 'master'
Revert "Merge branch '24704-download-repository-path' into 'master'" See merge request gitlab-org/gitlab-ce!27249
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/repository.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index a22e3c4b9dd..be9e926728c 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -231,12 +231,12 @@ module Gitlab
end
end
- def archive_metadata(ref, storage_path, project_path, format = "tar.gz", append_sha:, path: nil)
+ def archive_metadata(ref, storage_path, project_path, format = "tar.gz", append_sha:)
ref ||= root_ref
commit = Gitlab::Git::Commit.find(self, ref)
return {} if commit.nil?
- prefix = archive_prefix(ref, commit.id, project_path, append_sha: append_sha, path: path)
+ prefix = archive_prefix(ref, commit.id, project_path, append_sha: append_sha)
{
'ArchivePrefix' => prefix,
@@ -248,14 +248,13 @@ module Gitlab
# This is both the filename of the archive (missing the extension) and the
# name of the top-level member of the archive under which all files go
- def archive_prefix(ref, sha, project_path, append_sha:, path:)
+ def archive_prefix(ref, sha, project_path, append_sha:)
append_sha = (ref != sha) if append_sha.nil?
formatted_ref = ref.tr('/', '-')
prefix_segments = [project_path, formatted_ref]
prefix_segments << sha if append_sha
- prefix_segments << path.tr('/', '-').gsub(%r{^/|/$}, '') if path
prefix_segments.join('-')
end