From a9783c439bd6e3322b6fc72371c9fe3837a63be5 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon <grzesiek.bizon@gmail.com> Date: Wed, 13 Jan 2016 10:13:39 +0100 Subject: [PATCH] Make encoding of paths returned by metadata consistent (UTF-8) --- lib/gitlab/ci/build/artifacts/metadata.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/ci/build/artifacts/metadata.rb b/lib/gitlab/ci/build/artifacts/metadata.rb index 47efc51a76e..0c252c0bf30 100644 --- a/lib/gitlab/ci/build/artifacts/metadata.rb +++ b/lib/gitlab/ci/build/artifacts/metadata.rb @@ -20,7 +20,7 @@ module Gitlab end def errors - gzip do|gz| + gzip do |gz| read_string(gz) # version errors = read_string(gz) raise StandardError, 'Errors field not found!' unless errors @@ -36,7 +36,7 @@ module Gitlab end def to_path - Path.new(@path, *match!) + Path.new(@path.dup.force_encoding('UTF-8'), *match!) end private @@ -88,7 +88,7 @@ module Gitlab def read_string(gz) string_size = read_uint32(gz) - return false unless string_size + return nil unless string_size gz.read(string_size) end -- GitLab