scm: git: fix unit adapter test fails in Ruby 1.9 Linux latin-1 locale (#5251).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5065 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-03-08 12:45:32 +00:00
parent 15ebb42579
commit 4f5f98220e
1 changed files with 3 additions and 0 deletions

View File

@ -113,6 +113,9 @@ module Redmine
cmd_args << "#{identifier}:#{p}" if identifier cmd_args << "#{identifier}:#{p}" if identifier
scm_cmd(*cmd_args) do |io| scm_cmd(*cmd_args) do |io|
io.each_line do |line| io.each_line do |line|
if line.respond_to?(:force_encoding)
line.force_encoding('ASCII-8BIT')
end
e = line.chomp.to_s e = line.chomp.to_s
if e =~ /^\d+\s+(\w+)\s+([0-9a-f]{40})\s+([0-9-]+)\t(.+)$/ if e =~ /^\d+\s+(\w+)\s+([0-9a-f]{40})\s+([0-9-]+)\t(.+)$/
type = $1 type = $1