1 package Gitalist::Controller::Fragment::Commit;
3 use namespace::autoclean;
5 BEGIN { extends 'Catalyst::Controller' }
6 with 'Gitalist::URIStructure::Commit';
8 sub base : Chained('/fragment/repository/find') PathPart('') CaptureArgs(0) {}
12 my $commit = $c->stash->{Commit};
13 my($tree, $patch) = $c->stash->{Repository}->diff(
15 parent => $c->req->param('hp') || undef,
21 # XXX Hack hack hack, see View::SyntaxHighlight
22 blobs => [map $_->{diff}, @$patch],
27 after diff_fancy => sub {
29 $c->forward('View::SyntaxHighlight');
32 after diff_plain => sub {
34 $c->response->content_type('text/plain; charset=utf-8');
37 __PACKAGE__->meta->make_immutable;