lib/Gitalist/URIStructure/Fragment/WithLog.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Gitalist::URIStructure::Fragment::WithLog;
2 use MooseX::MethodAttributes::Role;
3 use namespace::autoclean;
4  
5 requires 'log';
6  
7 after log => sub {
8 my ($self, $c) = @_;
9 my $repository = $c->stash->{Repository};
10  
11 my %logargs = (
12 sha1 => $c->stash->{Commit}->sha1, # $commit->sha1
13 count => Gitalist->config->{paging}{log} || 25,
14 );
15  
16 my $page = $c->req->param('pg') || 0;
17 $logargs{skip} = abs $page * $logargs{count}
18 if $page;
19  
20 $c->stash(
21 page => $page,
22 log_lines => [$repository->list_revs(%logargs)],
23 refs => $repository->references,
24 );
25 };
26  
27 1;