Fixed bug in /summary where repos with < 10 branches display empty branches.
[catagits/Gitalist.git] / lib / Gitalist / Controller / Root.pm
index 289c9e6..de67ad3 100644 (file)
@@ -123,7 +123,7 @@ sub summary : Local {
         count => $maxitems,
     )],
     refs      => $project->references,
-    heads     => [ @heads[0 .. $maxitems] ],
+    heads     => [ @heads[0 .. ($#heads < $maxitems ? $#heads : $maxitems)] ],
     action    => 'summary',
   );
 }