$c->response->body($snap[1]);
}
+=head2 patch
+
+A raw patch for a given commit.
+
+=cut
+
+sub patch : Chained('find') Args(0) {
+ my ($self, $c) = @_;
+ $c->detach('patches', [1]);
+}
+
+=head2 patches
+
+The patcheset for a given commit ???
+
+=cut
+
+sub patches : Chained('find') Args(1) {
+ my ($self, $c, $count) = @_;
+ $count ||= Gitalist->config->{patches}{max};
+ my $commit = $c->stash->{Commit};
+ my $parent = $c->req->param('hp') || undef; # FIXME
+ my $patch = $commit->get_patch( $parent, $count );
+ $c->response->body($patch);
+ $c->response->content_type('text/plain');
+ $c->response->status(200);
+}
+
__PACKAGE__->meta->make_immutable;