aboutsummaryrefslogtreecommitdiffstats
path: root/ui-summary.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-summary.c')
-rw-r--r--ui-summary.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui-summary.c b/ui-summary.c
index 43582da..3d5eda8 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -162,7 +162,7 @@ static void cgit_print_branches()
162 cgit_print_branch(list.refs[i]); 162 cgit_print_branch(list.refs[i]);
163} 163}
164 164
165static void cgit_print_tags() 165static void cgit_print_tags(int maxcount)
166{ 166{
167 struct reflist list; 167 struct reflist list;
168 int i; 168 int i;
@@ -174,8 +174,12 @@ static void cgit_print_tags()
174 if (list.count == 0) 174 if (list.count == 0)
175 return; 175 return;
176 qsort(list.refs, list.count, sizeof(*list.refs), cmp_tag_age); 176 qsort(list.refs, list.count, sizeof(*list.refs), cmp_tag_age);
177 if (!maxcount)
178 maxcount = list.count;
179 else if (maxcount > list.count)
180 maxcount = list.count;
177 print_tag_header(); 181 print_tag_header();
178 for(i=0; i<list.count; i++) 182 for(i=0; i<maxcount; i++)
179 print_tag(list.refs[i]); 183 print_tag(list.refs[i]);
180} 184}
181 185
@@ -206,6 +210,6 @@ void cgit_print_summary()
206 html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>"); 210 html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
207 cgit_print_branches(); 211 cgit_print_branches();
208 html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>"); 212 html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
209 cgit_print_tags(); 213 cgit_print_tags(cgit_summary_tags);
210 html("</table>"); 214 html("</table>");
211} 215}