]> source.dussan.org Git - redmine.git/commitdiff
scm: use "ASCII-8BIT" in IO.popen() in Ruby 1.9.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 24 Feb 2011 04:03:16 +0000 (04:03 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 24 Feb 2011 04:03:16 +0000 (04:03 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4938 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/abstract_adapter.rb

index b0c93bd2ce4755032212a56c0e384c3cdd2d0132..2bd82f5bca2f96a8698e2cd14ee8e3b0ebeb136e 100644 (file)
@@ -200,7 +200,12 @@ module Redmine
             cmd = "#{cmd} 2>>#{RAILS_ROOT}/log/scm.stderr.log"
           end
           begin
-            IO.popen(cmd, "r+") do |io|
+            if RUBY_VERSION < '1.9'
+              mode = "r+"
+            else
+              mode = "r+:ASCII-8BIT"
+            end
+            IO.popen(cmd, mode) do |io|
               io.close_write
               block.call(io) if block_given?
             end