- if (get_sha1(fmt("refs/tags/%s", revname), sha1)) {
- cgit_print_error(fmt("Bad tag reference: %s", revname));
- return;
+ strbuf_addf(&fullref, "refs/tags/%s", revname);
+ if (get_oid(fullref.buf, &oid)) {
+ cgit_print_error_page(404, "Not found",
+ "Bad tag reference: %s", revname);
+ goto cleanup;