]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-summary.c
Make print_branch() handle refs not pointing at commits
[ps-cgit] / ui-summary.c
index 04a466a319f384b03ff92909e462aa7baaec5b8d..ba90510f0289d11dcfa9263cf86a03ae5c6a0bb3 100644 (file)
@@ -58,11 +58,17 @@ static int print_branch(struct refinfo *ref)
        html("<tr><td>");
        cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0);
        html("</td><td>");
-       cgit_print_age(info->commit->date, -1, NULL);
-       html("</td><td>");
-       html_txt(info->author);
-       html("</td><td>");
-       cgit_commit_link(info->subject, NULL, NULL, name, NULL);
+
+       if (ref->object->type == OBJ_COMMIT) {
+               cgit_print_age(info->commit->date, -1, NULL);
+               html("</td><td>");
+               html_txt(info->author);
+               html("</td><td>");
+               cgit_commit_link(info->subject, NULL, NULL, name, NULL);
+       } else {
+               html("</td><td></td><td>");
+               cgit_object_link(ref->object);
+       }
        html("</td></tr>\n");
        return 0;
 }