From 8614c00c8a3e34e6b081ba2dc1be7985acc4bd4b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 8 May 2007 15:49:20 +0000 Subject: Text files can now be viewed online when browsing the repository. git-svn-id: http://redmine.rubyforge.org/svn/trunk@521 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/svn_repos.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/models/svn_repos.rb') diff --git a/app/models/svn_repos.rb b/app/models/svn_repos.rb index 3fe698e38..b4503ce5f 100644 --- a/app/models/svn_repos.rb +++ b/app/models/svn_repos.rb @@ -174,6 +174,7 @@ module SvnRepos cmd << " --username #{@login} --password #{@password}" if @login cat = nil shellout(cmd) do |io| + io.binmode cat = io.read end return nil if $? && $?.exitstatus != 0 @@ -248,6 +249,10 @@ module SvnRepos def is_dir? 'dir' == self.kind end + + def is_text? + Redmine::MimeType.is_type?('text', name) + end end class Revisions < Array -- cgit v1.2.3