]> source.dussan.org Git - redmine.git/commitdiff
fix scm_iconv local variable name (#12228)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 28 Oct 2012 07:12:23 +0000 (07:12 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 28 Oct 2012 07:12:23 +0000 (07:12 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10741 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/abstract_adapter.rb
test/unit/lib/redmine/scm/adapters/git_adapter_test.rb

index c15965595fdc64a233f6f8756e12bbe8445c6ecf..28f5f16f8e44d0c705cdbc927ded49b566ff16d8 100644 (file)
@@ -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
index 028701c17cb982112726808c1b86090b7f94d4ff..e1fbf3b7468a6d5d170cabd2c1bdcaec8eb058f7 100644 (file)
@@ -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