Commit 318b4640 authored by Shinya Maeda's avatar Shinya Maeda

Use force_encoding(regex.encoding)

parent a6f6056c
...@@ -74,7 +74,7 @@ module Gitlab ...@@ -74,7 +74,7 @@ module Gitlab
match = "" match = ""
reverse_line do |line| reverse_line do |line|
matches = line.force_encoding(Encoding.default_external).scan(regex) matches = line.force_encoding(regex.encoding).scan(regex)
next unless matches.is_a?(Array) next unless matches.is_a?(Array)
next if matches.empty? next if matches.empty?
...@@ -86,7 +86,7 @@ module Gitlab ...@@ -86,7 +86,7 @@ module Gitlab
nil nil
rescue rescue
# if bad regex or something goes wrong we dont want to interrupt transition # if bad regex or something goes wrong we dont want to interrupt transition
# so we just silentrly ignore error for now # so we just silently ignore error for now
end end
private private
......
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