summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-08 13:22:53 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-08 13:22:53 +0000
commitf36f5d0fee44f0699e14efc79858f4acfe42fa80 (patch)
treedc0284113ac43b81c290e29baab36830fd673acd
parent4f5f98220ee6f0c9e3615de272c2f682b84955ff (diff)
downloadredmine-f36f5d0fee44f0699e14efc79858f4acfe42fa80.tar.gz
redmine-f36f5d0fee44f0699e14efc79858f4acfe42fa80.zip
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@5066 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index e246dc5df..44c11dca1 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -113,15 +113,15 @@ 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
sha = $2
size = $3
name = $4
+ if name.respond_to?(:force_encoding)
+ name.force_encoding(@path_encoding)
+ end
full_path = p.empty? ? name : "#{p}/#{name}"
n = scm_iconv('UTF-8', @path_encoding, name)
full_p = scm_iconv('UTF-8', @path_encoding, full_path)