]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-refs.c
authors: specify maintainers
[ps-cgit] / ui-refs.c
index 3fbaad07302d90e1cb127666c51deceb67f5c02d..c97b0c62924cc08c1e54bbcb4958d8c5898abb1e 100644 (file)
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -1,6 +1,6 @@
 /* ui-refs.c: browse symbolic refs
  *
- * Copyright (C) 2006 Lars Hjemli
+ * Copyright (C) 2006-2014 cgit Development Team <cgit@lists.zx2c4.com>
  *
  * Licensed under GNU General Public License v2
  *   (see COPYING for full license text)
@@ -155,9 +155,9 @@ static int print_tag(struct refinfo *ref)
        html("</td><td>");
        if (info) {
                if (info->tagger)
-                       html(info->tagger);
+                       html_txt(info->tagger);
        } else if (ref->object->type == OBJ_COMMIT) {
-               html(ref->commit->author);
+               html_txt(ref->commit->author);
        }
        html("</td><td colspan='2'>");
        if (info) {
@@ -197,10 +197,9 @@ void cgit_print_branches(int maxcount)
        if (maxcount == 0 || maxcount > list.count)
                maxcount = list.count;
 
-       if (maxcount < list.count) {
-               qsort(list.refs, list.count, sizeof(*list.refs), cmp_branch_age);
+       qsort(list.refs, list.count, sizeof(*list.refs), cmp_branch_age);
+       if (ctx.repo->branch_sort == 0)
                qsort(list.refs, maxcount, sizeof(*list.refs), cmp_ref_name);
-       }
 
        for (i = 0; i < maxcount; i++)
                print_branch(list.refs[i]);
@@ -241,9 +240,9 @@ void cgit_print_refs()
 
        html("<table class='list nowrap'>");
 
-       if (ctx.qry.path && !strncmp(ctx.qry.path, "heads", 5))
+       if (ctx.qry.path && !prefixcmp(ctx.qry.path, "heads"))
                cgit_print_branches(0);
-       else if (ctx.qry.path && !strncmp(ctx.qry.path, "tags", 4))
+       else if (ctx.qry.path && !prefixcmp(ctx.qry.path, "tags"))
                cgit_print_tags(0);
        else {
                cgit_print_branches(0);