From 4647c6fa3a9fbf58a4a2f60d31fc9a1a0633c3df Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 25 Jan 2012 09:15:08 +0200 Subject: [PATCH] fixes raw view for text files with code like *.rb --- app/controllers/refs_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb index d2be5ad..2f887a4 100644 --- a/app/controllers/refs_controller.rb +++ b/app/controllers/refs_controller.rb @@ -37,7 +37,12 @@ class RefsController < ApplicationController def blob if @tree.is_blob? - send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name) + send_data( + @tree.data, + :type => @tree.text? ? "text/plain" : @tree.mime_type, + :disposition => 'inline', + :filename => @tree.name + ) else head(404) end -- libgit2 0.21.2