$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;
sub base : Chained('/base') PathPart('') CaptureArgs(0) {}
+=head2 search
+
+The action for the search form.
+
+=cut
+
+sub search : Chained('base') Args(0) {
+ my($self, $c) = @_;
+ my $repository = $c->stash->{Repository};
+ # Lifted from /shortlog.
+ my %logargs = (
+# sha1 => $commit->sha1,
+# count => Gitalist->config->{paging}{log},
+# ($c->req->param('f') ? (file => $c->req->param('f')) : ()),
+ search => {
+ type => $c->req->param('type'),
+ text => $c->req->param('text'),
+ regexp => $c->req->param('regexp') || 0,
+ },
+ );
+
+ $c->stash(
+# commit => $commit,
+ results => [$repository->list_revs(%logargs)],
+ # This could be added - page => $page,
+ );
+}
+
+=head2 reflog
+
+Expose the local reflog. This may go away.
+
+=cut
+
+sub reflog : Chained('base') Args(0) {
+ my ( $self, $c ) = @_;
+ my @log = $c->stash->{Repository}->reflog(
+ '--since=yesterday'
+ );
+
+ $c->stash(
+ log => \@log,
+ );
+}
+
=head2 atom
Provides an atom feed for a given repository.
);
}
-=head2 reflog
-
-Expose the local reflog. This may go away.
-
-=cut
-
-sub reflog : Chained('base') Args(0) {
- my ( $self, $c ) = @_;
- my @log = $c->stash->{Repository}->reflog(
- '--since=yesterday'
- );
-
- $c->stash(
- log => \@log,
- );
-}
-
-=head2 search
-
-The action for the search form.
-
-=cut
-
-sub search : Chained('base') Args(0) {
- my($self, $c) = @_;
- my $repository = $c->stash->{Repository};
- my $commit = $self->_get_object($c);
- # Lifted from /shortlog.
- my %logargs = (
- sha1 => $commit->sha1,
- count => Gitalist->config->{paging}{log},
- ($c->req->param('f') ? (file => $c->req->param('f')) : ()),
- search => {
- type => $c->req->param('type'),
- text => $c->req->param('text'),
- regexp => $c->req->param('regexp') || 0,
- },
- );
-
- $c->stash(
- commit => $commit,
- results => [$repository->list_revs(%logargs)],
- # This could be added - page => $page,
- );
-}
-
=head2 search_help
Provides some help for the search form.
$c->response->status(200);
}
-=head2 patch
-
-A raw patch for a given commit.
-
-=cut
-
-sub patch : Chained('base') Args(0) {
- my ($self, $c) = @_;
- $c->detach('patches', [1]);
-}
-
-=head2 patches
-
-The patcheset for a given commit ???
-
-=cut
-
-sub patches : Chained('base') Args(0) {
- 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->get_patch( $parent, $count );
- $c->response->body($patch);
- $c->response->content_type('text/plain');
- $c->response->status(200);
-}
-
sub base : Chained('/root') PathPart('') CaptureArgs(0) {
my($self, $c) = @_;