Merge branch 'action-patches' into patches-intg
[catagits/Gitalist.git] / lib / Gitalist / Controller / Root.pm
index dfb43e3..17c8750 100644 (file)
@@ -442,18 +442,18 @@ sub rss : Local {
 
 sub patch : Local {
     my ($self, $c) = @_;
+    $c->detach('patches', [1]);
+}
+
+sub patches : Local {
+    my ($self, $c, $count) = @_;
+    $count ||= Gitalist->config->{patches}{max};
     my $commit = $self->_get_object($c);
     my $parent = $c->req->param('hp') || undef;
-    my $patch = $commit->patch( $parent );
+    my $patch = $commit->get_patch( $parent, $count );
     $c->response->body($patch);
     $c->response->content_type('text/plain');
     $c->response->status(200);
-
-}
-
-sub patches : Local {
-    # FIXME - implement patches
-    Carp::croak "Not implemented.";
 }
 
 sub snapshot : Local {