Commit 09e76f29 authored by Toshi MARUYAMA's avatar Toshi MARUYAMA Committed by Eric Davis

scm: git: support path encoding in adapter cat (#5251).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5042 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 107f92ab
......@@ -309,14 +309,16 @@ module Redmine
if identifier.nil?
identifier = 'HEAD'
end
cmd = "#{self.class.sq_bin} --git-dir #{target('')} show --no-color #{shell_quote(identifier + ':' + path)}"
cmd_args = %w|show --no-color|
cmd_args << "#{identifier}:#{scm_iconv(@path_encoding, 'UTF-8', path)}"
cat = nil
shellout(cmd) do |io|
scm_cmd(*cmd_args) do |io|
io.binmode
cat = io.read
end
return nil if $? && $?.exitstatus != 0
cat
rescue ScmCommandAborted
nil
end
class Revision < Redmine::Scm::Adapters::Revision
......
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