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.

Signed-off-by: Christian Hesse <mail@eworm.de>
Этот коммит содержится в:
Christian Hesse 2016-01-05 07:38:53 +01:00 коммит произвёл Jason A. Donenfeld
родитель 6edc84bc44
Коммит 559ab5ecc4
13 изменённых файлов: 27 добавлений и 27 удалений

Просмотреть файл

@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir) pdfdir = $(docdir)
mandir = $(prefix)/share/man mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h> SHA1_HEADER = <openssl/sha.h>
GIT_VER = 2.6.1 GIT_VER = 2.7.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz
INSTALL = install INSTALL = install
COPYTREE = cp -r COPYTREE = cp -r

2
git

@ -1 +1 @@
Subproject commit 22f698cb188243b313e024d618283e0293e37140 Subproject commit 754884255bb580df159e58defa81cdd30b5c430c

Просмотреть файл

@ -139,7 +139,7 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
return ret; return ret;
if (!skip_prefix(p, "tree ", &p)) if (!skip_prefix(p, "tree ", &p))
die("Bad commit: %s", sha1_to_hex(commit->object.sha1)); die("Bad commit: %s", oid_to_hex(&commit->object.oid));
p += sha1hex_len + 1; p += sha1hex_len + 1;
while (skip_prefix(p, "parent ", &p)) while (skip_prefix(p, "parent ", &p))
@ -199,7 +199,7 @@ struct taginfo *cgit_parse_tag(struct tag *tag)
const char *p; const char *p;
struct taginfo *ret = NULL; struct taginfo *ret = NULL;
data = read_sha1_file(tag->object.sha1, &type, &size); data = read_sha1_file(tag->object.oid.hash, &type, &size);
if (!data || type != OBJ_TAG) if (!data || type != OBJ_TAG)
goto cleanup; goto cleanup;

Просмотреть файл

@ -402,8 +402,8 @@ void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)
unsigned char *old_sha1 = NULL; unsigned char *old_sha1 = NULL;
if (commit->parents) if (commit->parents)
old_sha1 = commit->parents->item->object.sha1; old_sha1 = commit->parents->item->object.oid.hash;
cgit_diff_tree(old_sha1, commit->object.sha1, fn, prefix, cgit_diff_tree(old_sha1, commit->object.oid.hash, fn, prefix,
ctx.qry.ignorews); ctx.qry.ignorews);
} }

Просмотреть файл

@ -19,7 +19,7 @@ static void add_entry(struct commit *commit, const char *host)
struct commitinfo *info; struct commitinfo *info;
info = cgit_parse_commit(commit); info = cgit_parse_commit(commit);
hex = sha1_to_hex(commit->object.sha1); hex = oid_to_hex(&commit->object.oid);
html("<entry>\n"); html("<entry>\n");
html("<title>"); html("<title>");
html_txt(info->subject); html_txt(info->subject);

Просмотреть файл

@ -24,7 +24,7 @@ static int print_ref_info(const char *refname, const struct object_id *oid,
if (obj->type == OBJ_TAG) { if (obj->type == OBJ_TAG) {
if (!(obj = deref_tag(obj, refname, 0))) if (!(obj = deref_tag(obj, refname, 0)))
return 0; return 0;
htmlf("%s\t%s^{}\n", sha1_to_hex(obj->sha1), refname); htmlf("%s\t%s^{}\n", oid_to_hex(&obj->oid), refname);
} }
return 0; return 0;
} }

Просмотреть файл

@ -69,14 +69,14 @@ void cgit_print_commit(char *hex, const char *prefix)
cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time); cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time);
html("</td></tr>\n"); html("</td></tr>\n");
html("<tr><th>commit</th><td colspan='2' class='sha1'>"); html("<tr><th>commit</th><td colspan='2' class='sha1'>");
tmp = sha1_to_hex(commit->object.sha1); tmp = oid_to_hex(&commit->object.oid);
cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix); cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix);
html(" ("); html(" (");
cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix);
html(")</td></tr>\n"); html(")</td></tr>\n");
html("<tr><th>tree</th><td colspan='2' class='sha1'>"); html("<tr><th>tree</th><td colspan='2' class='sha1'>");
tmp = xstrdup(hex); tmp = xstrdup(hex);
cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL, cgit_tree_link(oid_to_hex(&commit->tree->object.oid), NULL, NULL,
ctx.qry.head, tmp, NULL); ctx.qry.head, tmp, NULL);
if (prefix) { if (prefix) {
html(" /"); html(" /");
@ -85,7 +85,7 @@ void cgit_print_commit(char *hex, const char *prefix)
free(tmp); free(tmp);
html("</td></tr>\n"); html("</td></tr>\n");
for (p = commit->parents; p; p = p->next) { for (p = commit->parents; p; p = p->next) {
parent = lookup_commit_reference(p->item->object.sha1); parent = lookup_commit_reference(p->item->object.oid.hash);
if (!parent) { if (!parent) {
html("<tr><td colspan='3'>"); html("<tr><td colspan='3'>");
cgit_print_error("Error reading parent commit"); cgit_print_error("Error reading parent commit");
@ -94,7 +94,7 @@ void cgit_print_commit(char *hex, const char *prefix)
} }
html("<tr><th>parent</th>" html("<tr><th>parent</th>"
"<td colspan='2' class='sha1'>"); "<td colspan='2' class='sha1'>");
tmp = tmp2 = sha1_to_hex(p->item->object.sha1); tmp = tmp2 = oid_to_hex(&p->item->object.oid);
if (ctx.repo->enable_subject_links) { if (ctx.repo->enable_subject_links) {
parent_info = cgit_parse_commit(parent); parent_info = cgit_parse_commit(parent);
tmp2 = parent_info->subject; tmp2 = parent_info->subject;
@ -102,7 +102,7 @@ void cgit_print_commit(char *hex, const char *prefix)
cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix); cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix);
html(" ("); html(" (");
cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex,
sha1_to_hex(p->item->object.sha1), prefix); oid_to_hex(&p->item->object.oid), prefix);
html(")</td></tr>"); html(")</td></tr>");
parents++; parents++;
} }
@ -135,7 +135,7 @@ void cgit_print_commit(char *hex, const char *prefix)
} }
if (parents < 3) { if (parents < 3) {
if (parents) if (parents)
tmp = sha1_to_hex(commit->parents->item->object.sha1); tmp = oid_to_hex(&commit->parents->item->object.oid);
else else
tmp = NULL; tmp = NULL;
cgit_print_diff(ctx.qry.sha1, tmp, prefix, 0, 0); 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,
"Bad commit: %s", sha1_to_hex(new_rev_sha1)); "Bad commit: %s", sha1_to_hex(new_rev_sha1));
return; return;
} }
new_tree_sha1 = commit->tree->object.sha1; new_tree_sha1 = commit->tree->object.oid.hash;
if (old_rev) { if (old_rev) {
if (get_sha1(old_rev, old_rev_sha1)) { if (get_sha1(old_rev, old_rev_sha1)) {
@ -422,7 +422,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
return; return;
} }
} else if (commit->parents && commit->parents->item) { } else if (commit->parents && commit->parents->item) {
hashcpy(old_rev_sha1, commit->parents->item->object.sha1); hashcpy(old_rev_sha1, commit->parents->item->object.oid.hash);
} else { } else {
hashclr(old_rev_sha1); hashclr(old_rev_sha1);
} }
@ -434,7 +434,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
"Bad commit: %s", sha1_to_hex(old_rev_sha1)); "Bad commit: %s", sha1_to_hex(old_rev_sha1));
return; return;
} }
old_tree_sha1 = commit2->tree->object.sha1; old_tree_sha1 = commit2->tree->object.oid.hash;
} else { } else {
old_tree_sha1 = NULL; old_tree_sha1 = NULL;
} }

Просмотреть файл

@ -82,14 +82,14 @@ void show_commit_decorations(struct commit *commit)
goto next; goto next;
strncpy(buf, deco->name + 13, sizeof(buf) - 1); strncpy(buf, deco->name + 13, sizeof(buf) - 1);
cgit_log_link(buf, NULL, "remote-deco", NULL, cgit_log_link(buf, NULL, "remote-deco", NULL,
sha1_to_hex(commit->object.sha1), oid_to_hex(&commit->object.oid),
ctx.qry.vpath, 0, NULL, NULL, ctx.qry.vpath, 0, NULL, NULL,
ctx.qry.showmsg, 0); ctx.qry.showmsg, 0);
} }
else { else {
strncpy(buf, deco->name, sizeof(buf) - 1); strncpy(buf, deco->name, sizeof(buf) - 1);
cgit_commit_link(buf, NULL, "deco", ctx.qry.head, cgit_commit_link(buf, NULL, "deco", ctx.qry.head,
sha1_to_hex(commit->object.sha1), oid_to_hex(&commit->object.oid),
ctx.qry.vpath); ctx.qry.vpath);
} }
next: next:
@ -148,8 +148,8 @@ static int show_commit(struct commit *commit, struct rev_info *revs)
rem_lines = 0; rem_lines = 0;
DIFF_OPT_SET(&revs->diffopt, RECURSIVE); DIFF_OPT_SET(&revs->diffopt, RECURSIVE);
diff_tree_sha1(parent->tree->object.sha1, diff_tree_sha1(parent->tree->object.oid.hash,
commit->tree->object.sha1, commit->tree->object.oid.hash,
"", &revs->diffopt); "", &revs->diffopt);
diffcore_std(&revs->diffopt); diffcore_std(&revs->diffopt);
@ -233,7 +233,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
} }
} }
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
sha1_to_hex(commit->object.sha1), ctx.qry.vpath); oid_to_hex(&commit->object.oid), ctx.qry.vpath);
show_commit_decorations(commit); show_commit_decorations(commit);
html("</td><td>"); html("</td><td>");
cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); 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)
strbuf_addstr(&msgbuf, info->msg); strbuf_addstr(&msgbuf, info->msg);
strbuf_addch(&msgbuf, '\n'); strbuf_addch(&msgbuf, '\n');
} }
format_display_notes(commit->object.sha1, format_display_notes(commit->object.oid.hash,
&msgbuf, PAGE_ENCODING, 0); &msgbuf, PAGE_ENCODING, 0);
strbuf_addch(&msgbuf, '\n'); strbuf_addch(&msgbuf, '\n');
strbuf_ltrim(&msgbuf); strbuf_ltrim(&msgbuf);

Просмотреть файл

@ -48,7 +48,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
return; return;
} }
} else if (commit->parents && commit->parents->item) { } else if (commit->parents && commit->parents->item) {
hashcpy(old_rev_sha1, commit->parents->item->object.sha1); hashcpy(old_rev_sha1, commit->parents->item->object.oid.hash);
} else { } else {
hashclr(old_rev_sha1); hashclr(old_rev_sha1);
} }

Просмотреть файл

@ -183,7 +183,7 @@ void cgit_print_plain(void)
if (!path_items.match) { if (!path_items.match) {
path_items.match = ""; path_items.match = "";
walk_tree_ctx.match_baselen = -1; walk_tree_ctx.match_baselen = -1;
print_dir(commit->tree->object.sha1, "", 0, ""); print_dir(commit->tree->object.oid.hash, "", 0, "");
walk_tree_ctx.match = 2; walk_tree_ctx.match = 2;
} }
else else

Просмотреть файл

@ -525,7 +525,7 @@ void cgit_object_link(struct object *obj)
{ {
char *page, *shortrev, *fullrev, *name; char *page, *shortrev, *fullrev, *name;
fullrev = sha1_to_hex(obj->sha1); fullrev = oid_to_hex(&obj->oid);
shortrev = xstrdup(fullrev); shortrev = xstrdup(fullrev);
shortrev[10] = '\0'; shortrev[10] = '\0';
if (obj->type == OBJ_COMMIT) { if (obj->type == OBJ_COMMIT) {

Просмотреть файл

@ -287,7 +287,7 @@ void cgit_print_tree(const char *rev, char *path)
walk_tree_ctx.curr_rev = xstrdup(rev); walk_tree_ctx.curr_rev = xstrdup(rev);
if (path == NULL) { if (path == NULL) {
ls_tree(commit->tree->object.sha1, NULL, &walk_tree_ctx); ls_tree(commit->tree->object.oid.hash, NULL, &walk_tree_ctx);
goto cleanup; goto cleanup;
} }