Commit 13775a44 authored by tmaruyama's avatar tmaruyama

Ruby1.9: scm: use :set_encoding instead of "RUBY_VERSION < '1.9'" for IO.popen (#10470)

git-svn-id: https://svn.redmine.org/redmine/trunk@9280 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 8d6f6245
......@@ -223,12 +223,9 @@ module Redmine
cmd = "#{cmd} 2>>#{shell_quote(Rails.root.join('log/scm.stderr.log').to_s)}"
end
begin
if RUBY_VERSION < '1.9'
mode = "r+"
else
mode = "r+:ASCII-8BIT"
end
mode = "r+"
IO.popen(cmd, mode) do |io|
io.set_encoding("ASCII-8BIT") if io.respond_to?(:set_encoding)
io.close_write
block.call(io) if block_given?
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment