diff options
| -rw-r--r-- | ui-tag.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -42,29 +42,29 @@ static void print_download_links(char *revname) | |||
| 42 | void cgit_print_tag(char *revname) | 42 | void cgit_print_tag(char *revname) |
| 43 | { | 43 | { |
| 44 | struct strbuf fullref = STRBUF_INIT; | 44 | struct strbuf fullref = STRBUF_INIT; |
| 45 | unsigned char sha1[20]; | 45 | struct object_id oid; |
| 46 | struct object *obj; | 46 | struct object *obj; |
| 47 | 47 | ||
| 48 | if (!revname) | 48 | if (!revname) |
| 49 | revname = ctx.qry.head; | 49 | revname = ctx.qry.head; |
| 50 | 50 | ||
| 51 | strbuf_addf(&fullref, "refs/tags/%s", revname); | 51 | strbuf_addf(&fullref, "refs/tags/%s", revname); |
| 52 | if (get_sha1(fullref.buf, sha1)) { | 52 | if (get_oid(fullref.buf, &oid)) { |
| 53 | cgit_print_error_page(404, "Not found", | 53 | cgit_print_error_page(404, "Not found", |
| 54 | "Bad tag reference: %s", revname); | 54 | "Bad tag reference: %s", revname); |
| 55 | goto cleanup; | 55 | goto cleanup; |
| 56 | } | 56 | } |
| 57 | obj = parse_object(sha1); | 57 | obj = parse_object(oid.hash); |
| 58 | if (!obj) { | 58 | if (!obj) { |
| 59 | cgit_print_error_page(500, "Internal server error", | 59 | cgit_print_error_page(500, "Internal server error", |
| 60 | "Bad object id: %s", sha1_to_hex(sha1)); | 60 | "Bad object id: %s", oid_to_hex(&oid)); |
| 61 | goto cleanup; | 61 | goto cleanup; |
| 62 | } | 62 | } |
| 63 | if (obj->type == OBJ_TAG) { | 63 | if (obj->type == OBJ_TAG) { |
| 64 | struct tag *tag; | 64 | struct tag *tag; |
| 65 | struct taginfo *info; | 65 | struct taginfo *info; |
| 66 | 66 | ||
| 67 | tag = lookup_tag(sha1); | 67 | tag = lookup_tag(oid.hash); |
| 68 | if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) { | 68 | if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) { |
| 69 | cgit_print_error_page(500, "Internal server error", | 69 | cgit_print_error_page(500, "Internal server error", |
| 70 | "Bad tag object: %s", revname); | 70 | "Bad tag object: %s", revname); |
| @@ -74,7 +74,7 @@ void cgit_print_tag(char *revname) | |||
| 74 | html("<table class='commit-info'>\n"); | 74 | html("<table class='commit-info'>\n"); |
| 75 | htmlf("<tr><td>tag name</td><td>"); | 75 | htmlf("<tr><td>tag name</td><td>"); |
| 76 | html_txt(revname); | 76 | html_txt(revname); |
| 77 | htmlf(" (%s)</td></tr>\n", sha1_to_hex(sha1)); | 77 | htmlf(" (%s)</td></tr>\n", oid_to_hex(&oid)); |
| 78 | if (info->tagger_date > 0) { | 78 | if (info->tagger_date > 0) { |
| 79 | html("<tr><td>tag date</td><td>"); | 79 | html("<tr><td>tag date</td><td>"); |
| 80 | html_txt(show_date(info->tagger_date, info->tagger_tz, | 80 | html_txt(show_date(info->tagger_date, info->tagger_tz, |
