summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-10-28 07:12:23 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-10-28 07:12:23 +0000
commit123d2b318f18b6115ff1225dd9017add51c7f234 (patch)
tree5aab2777c9ede8acb71c15558bf49a90ac6221e3
parent5a2c80cb48c4e876f93f0ed867dd8ec7afc0e008 (diff)
downloadredmine-123d2b318f18b6115ff1225dd9017add51c7f234.tar.gz
redmine-123d2b318f18b6115ff1225dd9017add51c7f234.zip
fix scm_iconv local variable name (#12228)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10741 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/scm/adapters/abstract_adapter.rb2
-rw-r--r--test/unit/lib/redmine/scm/adapters/git_adapter_test.rb17
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb
index c15965595..28f5f16f8 100644
--- a/lib/redmine/scm/adapters/abstract_adapter.rb
+++ b/lib/redmine/scm/adapters/abstract_adapter.rb
@@ -264,7 +264,7 @@ module Redmine
str.force_encoding(from)
begin
s = str.encode(to)
- rescue Exception => e
+ rescue Exception => err
logger.error("failed to convert from #{from} to #{to}. #{err}")
nil
end
diff --git a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
index 028701c17..e1fbf3b74 100644
--- a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
@@ -460,6 +460,23 @@ begin
assert_equal Time.gm(2009, 6, 19, 4, 37, 23), readme.lastrev.time
end
+ def test_entries_wrong_path_encoding
+ adpt = Redmine::Scm::Adapters::GitAdapter.new(
+ REPOSITORY_PATH,
+ nil,
+ nil,
+ nil,
+ 'EUC-JP'
+ )
+ entries1 = adpt.entries('latin-1-dir', '64f1f3e8')
+ assert entries1
+ assert_equal 3, entries1.size
+ f1 = entries1[1]
+ assert_equal nil, f1.name
+ assert_equal nil, f1.path
+ assert_equal 'file', f1.kind
+ end
+
def test_entries_latin_1_files
entries1 = @adapter.entries('latin-1-dir', '64f1f3e8')
assert entries1