Make print_branch() handle refs not pointing at commits
The master branch of stable/linux-2.6.20 currently references a tag object, which makes print_branch() die with a segfault. This teaches print_branch() to handle such cases more gracefully. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
parent
68ca032dbe
commit
cbcdbcf2bf
16
ui-summary.c
16
ui-summary.c
@ -58,11 +58,17 @@ static int print_branch(struct refinfo *ref)
|
|||||||
html("<tr><td>");
|
html("<tr><td>");
|
||||||
cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0);
|
cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0);
|
||||||
html("</td><td>");
|
html("</td><td>");
|
||||||
cgit_print_age(info->commit->date, -1, NULL);
|
|
||||||
html("</td><td>");
|
if (ref->object->type == OBJ_COMMIT) {
|
||||||
html_txt(info->author);
|
cgit_print_age(info->commit->date, -1, NULL);
|
||||||
html("</td><td>");
|
html("</td><td>");
|
||||||
cgit_commit_link(info->subject, NULL, NULL, name, NULL);
|
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");
|
html("</td></tr>\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user