Commit ac8beca4 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '29565-name-of-the-uncompressed-folder-of-a-tag-archive-changed' into 'master'

Fix archive prefix bug for refs containing dots

Closes #29565

See merge request !10007
parents 2668cc20 45976540
---
title: Fix archive prefix bug for refs containing dots
merge_request:
author:
......@@ -201,7 +201,7 @@ module Gitlab
def archive_prefix(ref, sha)
project_name = self.name.chomp('.git')
"#{project_name}-#{ref.parameterize}-#{sha}"
"#{project_name}-#{ref.tr('/', '-')}-#{sha}"
end
def archive_metadata(ref, storage_path, format = "tar.gz")
......
......@@ -90,6 +90,12 @@ describe Gitlab::Git::Repository, seed_helper: true do
expect(prefix).to eq("#{project_name}-test-branch-SHA")
end
it 'returns correct string for a ref containing dots' do
prefix = repository.archive_prefix('test.branch', 'SHA')
expect(prefix).to eq("#{project_name}-test.branch-SHA")
end
end
describe '#archive' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment