From 4f5f98220ee6f0c9e3615de272c2f682b84955ff Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 8 Mar 2011 12:45:32 +0000 Subject: [PATCH] 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 --- lib/redmine/scm/adapters/git_adapter.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index 19e32f6dc..e246dc5df 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -113,6 +113,9 @@ module Redmine cmd_args << "#{identifier}:#{p}" if identifier scm_cmd(*cmd_args) do |io| io.each_line do |line| + if line.respond_to?(:force_encoding) + line.force_encoding('ASCII-8BIT') + end e = line.chomp.to_s if e =~ /^\d+\s+(\w+)\s+([0-9a-f]{40})\s+([0-9-]+)\t(.+)$/ type = $1