Add Apache specific section to docs.
[catagits/Gitalist.git] / lib / Gitalist / Controller / Ref.pm
index b988d4d..46def57 100644 (file)
@@ -14,16 +14,14 @@ sub base : Chained('/repository/find') PathPart('') CaptureArgs(0) {}
 after commit => sub {
   my($self, $c) = @_;
 
-  $c->stash->{diff_tree} = ($c->stash->{Repository}->diff(
-    commit => $c->stash->{Commit},
-  ))[0];
+  $c->stash->{diff_tree} = ( $c->stash->{Commit}->diff )[0];
 };
 
 sub raw : Chained('find') Does('FilenameArgs') Args() {
     my ($self, $c) = @_;
     $c->forward('find_blob');
 
-    if(-T $c->stash->{blob}) {
+    if(!Gitalist::Utils::is_binary($c->stash->{blob})) {
         $c->response->content_type('text/plain; charset=utf-8');
     } else {
         my $ft = File::Type->new();
@@ -33,9 +31,16 @@ sub raw : Chained('find') Does('FilenameArgs') Args() {
         );
     }
 
+    utf8::decode($c->stash->{blob});
     $c->response->body(delete $c->stash->{blob});
 }
 
+=encoding UTF-8
+
+=head1 NAME
+
+Gitalist::Controller::Ref - Controller::Ref module for Gitalist
+
 =head2 snapshot
 
 Provides a snapshot of a given commit.