summaryrefslogtreecommitdiffstats
path: root/lib/redmine
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-08 05:17:43 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-08 05:17:43 +0000
commit7e6a5ec7ab215347553ed4ffbc4fee91bc5b74ff (patch)
treea20b9a4aff31b82ad618a95a7ae063905104b5fb /lib/redmine
parentc809c0c49815259a9b75fb3abc3fcfb2782efebd (diff)
downloadredmine-7e6a5ec7ab215347553ed4ffbc4fee91bc5b74ff.tar.gz
redmine-7e6a5ec7ab215347553ed4ffbc4fee91bc5b74ff.zip
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
Diffstat (limited to 'lib/redmine')
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index 69077eadc..b1db687e1 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -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