Merge branch 'model-reorg'
[catagits/Gitalist.git] / lib / Gitalist / Controller / Root.pm
index 44a5a8d..289c9e6 100644 (file)
@@ -113,17 +113,19 @@ sub summary : Local {
   my $project = $c->stash->{Project};
   $c->detach('error_404') unless $project;
   my $commit = $self->_get_commit($c);
+  my @heads  = $project->heads;
+  my $maxitems = Gitalist->config->{paging}{summary} || 10;
   $c->stash(
     commit    => $commit,
     info      => $project->info,
     log_lines => [$project->list_revs(
         sha1 => $commit->sha1,
-        count => Gitalist->config->{paging}{summary} || 10
+        count => $maxitems,
     )],
     refs      => $project->references,
-    heads     => [$project->heads],
+    heads     => [ @heads[0 .. $maxitems] ],
     action    => 'summary',
-);
+  );
 }
 
 =head2 heads