diff options
Diffstat (limited to 'lib/gitlab/ci/build/artifacts/metadata.rb')
-rw-r--r-- | lib/gitlab/ci/build/artifacts/metadata.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/ci/build/artifacts/metadata.rb b/lib/gitlab/ci/build/artifacts/metadata.rb index d0ab4916c90..5748b8e34cf 100644 --- a/lib/gitlab/ci/build/artifacts/metadata.rb +++ b/lib/gitlab/ci/build/artifacts/metadata.rb @@ -18,7 +18,11 @@ module Gitlab def initialize(stream, path, **opts) @stream = stream - @path = path + + # Ensure to remove any ./ prefix from the path + # so that the pattern matching will work as expected + @path = path.gsub(%r{^\./}, '') + @opts = opts @full_version = read_version end @@ -59,7 +63,7 @@ module Gitlab entries = {} child_pattern = '[^/]*/?$' unless @opts[:recursive] - match_pattern = /^#{Regexp.escape(@path)}#{child_pattern}/ + match_pattern = /^#{Regexp.escape(path)}#{child_pattern}/ until gz.eof? begin |