Update to git version v2.7.0. * Upstream commit ed1c9977cb1b63e4270ad8bdf967a2d02580aa08 (Remove get_object_hash.) changed API: Convert all instances of get_object_hash to use an appropriate reference to the hash member of the oid member of struct object. This provides no functional change, as it is essentially a macro substitution.
Unified · Split
| @@ -14,7 +14,7 @@ htmldir = $(docdir) · 13 unmodified lines | ||
| 14 | 14 | pdfdir = $(docdir) |
| 15 | 15 | mandir = $(prefix)/share/man |
| 16 | 16 | SHA1_HEADER = <openssl/sha.h> |
| 17 | −GIT_VER = 2.6.1 | |
| 17 | +GIT_VER = 2.7.0 | |
| 18 | 18 | GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz |
| 19 | 19 | INSTALL = install |
| 20 | 20 | COPYTREE = cp -r |
| @@ -1 +1 @@ | ||
| 1 | −Subproject commit 22f698cb188243b313e024d618283e0293e37140 | |
| 1 | +Subproject commit 754884255bb580df159e58defa81cdd30b5c430c | |
| @@ -139,7 +139,7 @@ struct commitinfo *cgit_parse_commit(struct commit *commit) · 138 unmodified lines | ||
| 139 | 139 | return ret; |
| 140 | 140 | |
| 141 | 141 | if (!skip_prefix(p, "tree ", &p)) |
| 142 | − die("Bad commit: %s", sha1_to_hex(commit->object.sha1)); | |
| 142 | + die("Bad commit: %s", oid_to_hex(&commit->object.oid)); | |
| 143 | 143 | p += sha1hex_len + 1; |
| 144 | 144 | |
| 145 | 145 | while (skip_prefix(p, "parent ", &p)) |
| @@ -199,7 +199,7 @@ struct taginfo *cgit_parse_tag(struct tag *tag) · 53 unmodified lines | ||
| 199 | 199 | const char *p; |
| 200 | 200 | struct taginfo *ret = NULL; |
| 201 | 201 | |
| 202 | − data = read_sha1_file(tag->object.sha1, &type, &size); | |
| 202 | + data = read_sha1_file(tag->object.oid.hash, &type, &size); | |
| 203 | 203 | if (!data || type != OBJ_TAG) |
| 204 | 204 | goto cleanup; |
| 205 | 205 | |
| @@ -402,8 +402,8 @@ void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix) · 401 unmodified lines | ||
| 402 | 402 | unsigned char *old_sha1 = NULL; |
| 403 | 403 | |
| 404 | 404 | if (commit->parents) |
| 405 | − old_sha1 = commit->parents->item->object.sha1; | |
| 406 | − cgit_diff_tree(old_sha1, commit->object.sha1, fn, prefix, | |
| 405 | + old_sha1 = commit->parents->item->object.oid.hash; | |
| 406 | + cgit_diff_tree(old_sha1, commit->object.oid.hash, fn, prefix, | |
| 407 | 407 | ctx.qry.ignorews); |
| 408 | 408 | } |
| 409 | 409 | |
| @@ -19,7 +19,7 @@ static void add_entry(struct commit *commit, const char *host) · 18 unmodified lines | ||
| 19 | 19 | struct commitinfo *info; |
| 20 | 20 | |
| 21 | 21 | info = cgit_parse_commit(commit); |
| 22 | − hex = sha1_to_hex(commit->object.sha1); | |
| 22 | + hex = oid_to_hex(&commit->object.oid); | |
| 23 | 23 | html("<entry>\n"); |
| 24 | 24 | html("<title>"); |
| 25 | 25 | html_txt(info->subject); |
| @@ -24,7 +24,7 @@ static int print_ref_info(const char *refname, const struct object_id *oid, · 23 unmodified lines | ||
| 24 | 24 | if (obj->type == OBJ_TAG) { |
| 25 | 25 | if (!(obj = deref_tag(obj, refname, 0))) |
| 26 | 26 | return 0; |
| 27 | − htmlf("%s\t%s^{}\n", sha1_to_hex(obj->sha1), refname); | |
| 27 | + htmlf("%s\t%s^{}\n", oid_to_hex(&obj->oid), refname); | |
| 28 | 28 | } |
| 29 | 29 | return 0; |
| 30 | 30 | } |
| @@ -69,14 +69,14 @@ void cgit_print_commit(char *hex, const char *prefix) · 68 unmodified lines | ||
| 69 | 69 | cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time); |
| 70 | 70 | html("</td></tr>\n"); |
| 71 | 71 | html("<tr><th>commit</th><td colspan='2' class='sha1'>"); |
| 72 | − tmp = sha1_to_hex(commit->object.sha1); | |
| 72 | + tmp = oid_to_hex(&commit->object.oid); | |
| 73 | 73 | cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix); |
| 74 | 74 | html(" ("); |
| 75 | 75 | cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); |
| 76 | 76 | html(")</td></tr>\n"); |
| 77 | 77 | html("<tr><th>tree</th><td colspan='2' class='sha1'>"); |
| 78 | 78 | tmp = xstrdup(hex); |
| 79 | − cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL, | |
| 79 | + cgit_tree_link(oid_to_hex(&commit->tree->object.oid), NULL, NULL, | |
| 80 | 80 | ctx.qry.head, tmp, NULL); |
| 81 | 81 | if (prefix) { |
| 82 | 82 | html(" /"); |
| @@ -85,7 +85,7 @@ void cgit_print_commit(char *hex, const char *prefix) · 2 unmodified lines | ||
| 85 | 85 | free(tmp); |
| 86 | 86 | html("</td></tr>\n"); |
| 87 | 87 | for (p = commit->parents; p; p = p->next) { |
| 88 | − parent = lookup_commit_reference(p->item->object.sha1); | |
| 88 | + parent = lookup_commit_reference(p->item->object.oid.hash); | |
| 89 | 89 | if (!parent) { |
| 90 | 90 | html("<tr><td colspan='3'>"); |
| 91 | 91 | cgit_print_error("Error reading parent commit"); |
| @@ -94,7 +94,7 @@ void cgit_print_commit(char *hex, const char *prefix) · 2 unmodified lines | ||
| 94 | 94 | } |
| 95 | 95 | html("<tr><th>parent</th>" |
| 96 | 96 | "<td colspan='2' class='sha1'>"); |
| 97 | − tmp = tmp2 = sha1_to_hex(p->item->object.sha1); | |
| 97 | + tmp = tmp2 = oid_to_hex(&p->item->object.oid); | |
| 98 | 98 | if (ctx.repo->enable_subject_links) { |
| 99 | 99 | parent_info = cgit_parse_commit(parent); |
| 100 | 100 | tmp2 = parent_info->subject; |
| @@ -102,7 +102,7 @@ void cgit_print_commit(char *hex, const char *prefix) · 1 unmodified line | ||
| 102 | 102 | cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix); |
| 103 | 103 | html(" ("); |
| 104 | 104 | cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, |
| 105 | − sha1_to_hex(p->item->object.sha1), prefix); | |
| 105 | + oid_to_hex(&p->item->object.oid), prefix); | |
| 106 | 106 | html(")</td></tr>"); |
| 107 | 107 | parents++; |
| 108 | 108 | } |
| @@ -135,7 +135,7 @@ void cgit_print_commit(char *hex, const char *prefix) · 26 unmodified lines | ||
| 135 | 135 | } |
| 136 | 136 | if (parents < 3) { |
| 137 | 137 | if (parents) |
| 138 | − tmp = sha1_to_hex(commit->parents->item->object.sha1); | |
| 138 | + tmp = oid_to_hex(&commit->parents->item->object.oid); | |
| 139 | 139 | else |
| 140 | 140 | tmp = NULL; |
| 141 | 141 | cgit_print_diff(ctx.qry.sha1, tmp, prefix, 0, 0); |
| @@ -413,7 +413,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, · 412 unmodified lines | ||
| 413 | 413 | "Bad commit: %s", sha1_to_hex(new_rev_sha1)); |
| 414 | 414 | return; |
| 415 | 415 | } |
| 416 | − new_tree_sha1 = commit->tree->object.sha1; | |
| 416 | + new_tree_sha1 = commit->tree->object.oid.hash; | |
| 417 | 417 | |
| 418 | 418 | if (old_rev) { |
| 419 | 419 | if (get_sha1(old_rev, old_rev_sha1)) { |
| @@ -422,7 +422,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, · 2 unmodified lines | ||
| 422 | 422 | return; |
| 423 | 423 | } |
| 424 | 424 | } else if (commit->parents && commit->parents->item) { |
| 425 | − hashcpy(old_rev_sha1, commit->parents->item->object.sha1); | |
| 425 | + hashcpy(old_rev_sha1, commit->parents->item->object.oid.hash); | |
| 426 | 426 | } else { |
| 427 | 427 | hashclr(old_rev_sha1); |
| 428 | 428 | } |
| @@ -434,7 +434,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, · 5 unmodified lines | ||
| 434 | 434 | "Bad commit: %s", sha1_to_hex(old_rev_sha1)); |
| 435 | 435 | return; |
| 436 | 436 | } |
| 437 | − old_tree_sha1 = commit2->tree->object.sha1; | |
| 437 | + old_tree_sha1 = commit2->tree->object.oid.hash; | |
| 438 | 438 | } else { |
| 439 | 439 | old_tree_sha1 = NULL; |
| 440 | 440 | } |
| @@ -82,14 +82,14 @@ void show_commit_decorations(struct commit *commit) · 81 unmodified lines | ||
| 82 | 82 | goto next; |
| 83 | 83 | strncpy(buf, deco->name + 13, sizeof(buf) - 1); |
| 84 | 84 | cgit_log_link(buf, NULL, "remote-deco", NULL, |
| 85 | − sha1_to_hex(commit->object.sha1), | |
| 85 | + oid_to_hex(&commit->object.oid), | |
| 86 | 86 | ctx.qry.vpath, 0, NULL, NULL, |
| 87 | 87 | ctx.qry.showmsg, 0); |
| 88 | 88 | } |
| 89 | 89 | else { |
| 90 | 90 | strncpy(buf, deco->name, sizeof(buf) - 1); |
| 91 | 91 | cgit_commit_link(buf, NULL, "deco", ctx.qry.head, |
| 92 | − sha1_to_hex(commit->object.sha1), | |
| 92 | + oid_to_hex(&commit->object.oid), | |
| 93 | 93 | ctx.qry.vpath); |
| 94 | 94 | } |
| 95 | 95 | next: |
| @@ -148,8 +148,8 @@ static int show_commit(struct commit *commit, struct rev_info *revs) · 52 unmodified lines | ||
| 148 | 148 | rem_lines = 0; |
| 149 | 149 | |
| 150 | 150 | DIFF_OPT_SET(&revs->diffopt, RECURSIVE); |
| 151 | − diff_tree_sha1(parent->tree->object.sha1, | |
| 152 | − commit->tree->object.sha1, | |
| 151 | + diff_tree_sha1(parent->tree->object.oid.hash, | |
| 152 | + commit->tree->object.oid.hash, | |
| 153 | 153 | "", &revs->diffopt); |
| 154 | 154 | diffcore_std(&revs->diffopt); |
| 155 | 155 | |
| @@ -233,7 +233,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) · 77 unmodified lines | ||
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
| 236 | − sha1_to_hex(commit->object.sha1), ctx.qry.vpath); | |
| 236 | + oid_to_hex(&commit->object.oid), ctx.qry.vpath); | |
| 237 | 237 | show_commit_decorations(commit); |
| 238 | 238 | html("</td><td>"); |
| 239 | 239 | cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); |
| @@ -269,7 +269,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) · 29 unmodified lines | ||
| 269 | 269 | strbuf_addstr(&msgbuf, info->msg); |
| 270 | 270 | strbuf_addch(&msgbuf, '\n'); |
| 271 | 271 | } |
| 272 | − format_display_notes(commit->object.sha1, | |
| 272 | + format_display_notes(commit->object.oid.hash, | |
| 273 | 273 | &msgbuf, PAGE_ENCODING, 0); |
| 274 | 274 | strbuf_addch(&msgbuf, '\n'); |
| 275 | 275 | strbuf_ltrim(&msgbuf); |
| @@ -48,7 +48,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, · 47 unmodified lines | ||
| 48 | 48 | return; |
| 49 | 49 | } |
| 50 | 50 | } else if (commit->parents && commit->parents->item) { |
| 51 | − hashcpy(old_rev_sha1, commit->parents->item->object.sha1); | |
| 51 | + hashcpy(old_rev_sha1, commit->parents->item->object.oid.hash); | |
| 52 | 52 | } else { |
| 53 | 53 | hashclr(old_rev_sha1); |
| 54 | 54 | } |
| @@ -183,7 +183,7 @@ void cgit_print_plain(void) · 182 unmodified lines | ||
| 183 | 183 | if (!path_items.match) { |
| 184 | 184 | path_items.match = ""; |
| 185 | 185 | walk_tree_ctx.match_baselen = -1; |
| 186 | − print_dir(commit->tree->object.sha1, "", 0, ""); | |
| 186 | + print_dir(commit->tree->object.oid.hash, "", 0, ""); | |
| 187 | 187 | walk_tree_ctx.match = 2; |
| 188 | 188 | } |
| 189 | 189 | else |
| @@ -525,7 +525,7 @@ void cgit_object_link(struct object *obj) · 524 unmodified lines | ||
| 525 | 525 | { |
| 526 | 526 | char *page, *shortrev, *fullrev, *name; |
| 527 | 527 | |
| 528 | − fullrev = sha1_to_hex(obj->sha1); | |
| 528 | + fullrev = oid_to_hex(&obj->oid); | |
| 529 | 529 | shortrev = xstrdup(fullrev); |
| 530 | 530 | shortrev[10] = '\0'; |
| 531 | 531 | if (obj->type == OBJ_COMMIT) { |
| @@ -287,7 +287,7 @@ void cgit_print_tree(const char *rev, char *path) · 286 unmodified lines | ||
| 287 | 287 | walk_tree_ctx.curr_rev = xstrdup(rev); |
| 288 | 288 | |
| 289 | 289 | if (path == NULL) { |
| 290 | − ls_tree(commit->tree->object.sha1, NULL, &walk_tree_ctx); | |
| 290 | + ls_tree(commit->tree->object.oid.hash, NULL, &walk_tree_ctx); | |
| 291 | 291 | goto cleanup; |
| 292 | 292 | } |
| 293 | 293 | |