Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3f0c18f8
Commit
3f0c18f8
authored
Jan 13, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify encoding related implementation in artifacts metadata
parent
a9783c43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
lib/gitlab/ci/build/artifacts/metadata.rb
lib/gitlab/ci/build/artifacts/metadata.rb
+5
-6
No files found.
lib/gitlab/ci/build/artifacts/metadata.rb
View file @
3f0c18f8
...
@@ -10,8 +10,7 @@ module Gitlab
...
@@ -10,8 +10,7 @@ module Gitlab
attr_reader
:file
,
:path
,
:full_version
attr_reader
:file
,
:path
,
:full_version
def
initialize
(
file
,
path
)
def
initialize
(
file
,
path
)
@file
=
file
@file
,
@path
=
file
,
path
@path
=
path
.
force_encoding
(
'ASCII-8BIT'
)
@full_version
=
read_version
@full_version
=
read_version
end
end
...
@@ -36,7 +35,7 @@ module Gitlab
...
@@ -36,7 +35,7 @@ module Gitlab
end
end
def
to_path
def
to_path
Path
.
new
(
@path
.
dup
.
force_encoding
(
'UTF-8'
)
,
*
match!
)
Path
.
new
(
@path
,
*
match!
)
end
end
private
private
...
@@ -48,11 +47,11 @@ module Gitlab
...
@@ -48,11 +47,11 @@ module Gitlab
until
gz
.
eof?
do
until
gz
.
eof?
do
begin
begin
path
=
read_string
(
gz
)
path
=
read_string
(
gz
)
.
force_encoding
(
'UTF-8'
)
meta
=
read_string
(
gz
)
meta
=
read_string
(
gz
)
.
force_encoding
(
'UTF-8'
)
next
unless
path
.
valid_encoding?
&&
meta
.
valid_encoding?
next
unless
path
=~
match_pattern
next
unless
path
=~
match_pattern
next
unless
path
.
force_encoding
(
'UTF-8'
).
valid_encoding?
next
if
path
=~
invalid_pattern
next
if
path
=~
invalid_pattern
paths
.
push
(
path
)
paths
.
push
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment