Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Drop tag page checks that cannot fire
parse_object only hands back a tag it has parsed, and an ident is split
into a name and an address together or not at all, so a tagger always
has an address, if only <>.
Diffstat (limited to 'source')
| -rw-r--r-- | source/ui-tag.c | 18 |
1 file changed, 7 insertions, 11 deletions
diff --git a/source/ui-tag.c b/source/ui-tag.c index f9ce6b3..1242a61 100644 --- a/source/ui-tag.c +++ b/source/ui-tag.c @@ -38,11 +38,9 @@ static void print_date_row(struct taginfo *info) static void print_tagger_row(struct taginfo *info) { html("<tr><th scope='row'>tagged by</th><td>"); - // A tag can carry a tagger with no address, and a filter must not be - // handed a NULL argument. - cgit_open_filter(ctx.repo->email_filter, info->tagger_email ? info->tagger_email : "", "tag"); + cgit_open_filter(ctx.repo->email_filter, info->tagger_email, "tag"); html_txt(info->tagger); - if (info->tagger_email && ctx.cfg.enable_plain_email) { + if (ctx.cfg.enable_plain_email) { html(" "); html_txt(info->tagger_email); } @@ -98,20 +96,18 @@ static void print_message(char *msg) } } -static void print_annotated_tag(const char *revname, const struct object_id *oid) +static void print_annotated_tag(const char *revname, struct tag *tag) { - struct tag *tag; - struct taginfo *info; + struct taginfo *info = cgit_parse_tag(tag); - tag = lookup_tag(the_repository, oid); - if (!tag || parse_tag(the_repository, tag) || !(info = cgit_parse_tag(tag))) { + if (!info) { cgit_print_error_page(500, "Internal Server Error", "Bad tag object: %s", revname); return; } cgit_print_layout_start(); html("<table class='commit-info'>\n"); - print_name_row(revname, oid); + print_name_row(revname, &tag->object.oid); if (info->tagger_date > 0) print_date_row(info); if (info->tagger) @@ -167,7 +163,7 @@ void cgit_print_tag(char *revname) } cgit_prefix_title(revname); if (obj->type == OBJ_TAG) - print_annotated_tag(revname, &oid); + print_annotated_tag(revname, (struct tag *)obj); else print_lightweight_tag(revname, obj); |
