about summary refs log tree commit diff stats
path: root/ui-tag.c
diff options
context:
space:
mode:
authorChristian Hesse2016-09-29 22:14:28 +0200
committerChristian Hesse2016-10-04 09:47:18 +0200
commit28185ae40a82d3304ace805c9a44e933270bd581 (patch)
tree1ca612de7bec52bbbd735c448f5e07ec8424f30c /ui-tag.c
parentui-snapshot: replace 'unsigned char sha1[20]' with 'struct object_id oid' (diff)
downloadcgit-28185ae40a82d3304ace805c9a44e933270bd581.tar.gz
cgit-28185ae40a82d3304ace805c9a44e933270bd581.zip
ui-tag: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...
Diffstat (limited to 'ui-tag.c')
-rw-r--r--ui-tag.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ui-tag.c b/ui-tag.c index 3fa63b3..afd7d61 100644 --- a/ui-tag.c +++ b/ui-tag.c
@@ -42,29 +42,29 @@ static void print_download_links(char *revname)
42void cgit_print_tag(char *revname) 42void 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,