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:
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r--app/models/ci/build.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index f6783e21d90..df51a5ce079 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -352,15 +352,15 @@ module Ci
def artifacts_metadata_for_path(path)
return [] unless artifacts_metadata.exists?
paths, metadata = [], []
- meta_path = path.sub(/^\.\//, '')
+ metadata_path = path.sub(/^\.\//, '')
File.open(artifacts_metadata.path) do |file|
gzip = Zlib::GzipReader.new(file)
gzip.each_line do |line|
- if line =~ %r{^#{meta_path}[^/]+/?\s}
- path, meta = line.split(' ')
- paths << path
- metadata << JSON.parse(meta)
+ if line =~ %r{^#{Regexp.escape(metadata_path)}[^/\s]+/?\s}
+ matched_path, matched_meta = line.split(' ')
+ paths << matched_path
+ metadata << JSON.parse(matched_meta)
end
end
gzip.close