cgit

commit 559ab5ecc4445c8477ecf62c9fc97efa412dd562

Author: Christian Hesse <mail@eworm.de>

git: update to v2.7.0

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>

 Makefile | 2 +-
 parsing.c | 4 ++--
 shared.c | 4 ++--
 ui-atom.c | 2 +-
 ui-clone.c | 2 +-
 ui-commit.c | 12 ++++++------
 ui-diff.c | 6 +++---
 ui-log.c | 12 ++++++------
 ui-patch.c | 2 +-
 ui-plain.c | 2 +-
 ui-shared.c | 2 +-
 ui-tree.c | 2 +-


diff --git a/Makefile b/Makefile
index 77b9f60d3275a63da579624fb9c79d6f9707cb3e..9bb9cd574121f0f4a90e771f9eebdad93f62a7c3 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
 pdfdir = $(docdir)
 mandir = $(prefix)/share/man
 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
 INSTALL = install
 COPYTREE = cp -r








diff --git a/parsing.c b/parsing.c
index f903c7c220285246faacfc1beeedb5081ffbf61b..5283e58fc8b0cad9cfc067dff7ab69f271808616 100644
--- a/parsing.c
+++ b/parsing.c
@@ -139,7 +139,7 @@ 	if (!p)
 		return ret;
 
 	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;
 
 	while (skip_prefix(p, "parent ", &p))
@@ -199,7 +199,7 @@ 	unsigned long size;
 	const char *p;
 	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)
 		goto cleanup;
 




diff --git a/shared.c b/shared.c
index e216c642a4f374c4e7fce922c66c31527eb6b522..42b2ddc25ea90328fd3f2b08eb73929012df3098 100644
--- a/shared.c
+++ b/shared.c
@@ -402,8 +402,8 @@ {
 	unsigned char *old_sha1 = NULL;
 
 	if (commit->parents)
-		old_sha1 = commit->parents->item->object.sha1;
-	cgit_diff_tree(old_sha1, commit->object.sha1, fn, prefix,
+		old_sha1 = commit->parents->item->object.oid.hash;
+	cgit_diff_tree(old_sha1, commit->object.oid.hash, fn, prefix,
 		       ctx.qry.ignorews);
 }
 




diff --git a/ui-atom.c b/ui-atom.c
index e186299e57c17143f1b3251bd1303ec82a382a21..11ea0c0a27c92e02a5109cf5dbbee9749ad5acf8 100644
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -19,7 +19,7 @@ 	char *mail, *t, *t2;
 	struct commitinfo *info;
 
 	info = cgit_parse_commit(commit);
-	hex = sha1_to_hex(commit->object.sha1);
+	hex = oid_to_hex(&commit->object.oid);
 	html("<entry>\n");
 	html("<title>");
 	html_txt(info->subject);




diff --git a/ui-clone.c b/ui-clone.c
index f7b0b047963c6192430f4c9580734f61c083c123..5f6606acc76698e15d4f969df4c048a281f25106 100644
--- a/ui-clone.c
+++ b/ui-clone.c
@@ -24,7 +24,7 @@ 	htmlf("%s\t%s\n", oid_to_hex(oid), refname);
 	if (obj->type == OBJ_TAG) {
 		if (!(obj = deref_tag(obj, refname, 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;
 }




diff --git a/ui-commit.c b/ui-commit.c
index 2bca7a019ea67a9e0c63f2578ed9ff076dd6d5bd..0c3d740c45080e8c7c0c1c9341a4cff62b2fb5c9 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -69,14 +69,14 @@ 	html("");
 	cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time);
 	html("</td></tr>\n");
 	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);
 	html(" (");
 	cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix);
 	html(")</td></tr>\n");
 	html("<tr><th>tree</th><td colspan='2' class='sha1'>");
 	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);
 	if (prefix) {
 		html(" /");
@@ -85,7 +85,7 @@ 	}
 	free(tmp);
 	html("</td></tr>\n");
 	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) {
 			html("<tr><td colspan='3'>");
 			cgit_print_error("Error reading parent commit");
@@ -94,7 +94,7 @@ 			continue;
 		}
 		html("<tr><th>parent</th>"
 		     "<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) {
 			parent_info = cgit_parse_commit(parent);
 			tmp2 = parent_info->subject;
@@ -102,7 +102,7 @@ 		}
 		cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix);
 		html(" (");
 		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>");
 		parents++;
 	}
@@ -135,7 +135,7 @@ 		html("");
 	}
 	if (parents < 3) {
 		if (parents)
-			tmp = sha1_to_hex(commit->parents->item->object.sha1);
+			tmp = oid_to_hex(&commit->parents->item->object.oid);
 		else
 			tmp = NULL;
 		cgit_print_diff(ctx.qry.sha1, tmp, prefix, 0, 0);




diff --git a/ui-diff.c b/ui-diff.c
index 5d18296862c19ac33606cc7a12d01da416215ec8..52ed9426747088c21cd0de74b0f8efe58aceb073 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -413,7 +413,7 @@ 		cgit_print_error_page(404, "Not found",
 			"Bad commit: %s", sha1_to_hex(new_rev_sha1));
 		return;
 	}
-	new_tree_sha1 = commit->tree->object.sha1;
+	new_tree_sha1 = commit->tree->object.oid.hash;
 
 	if (old_rev) {
 		if (get_sha1(old_rev, old_rev_sha1)) {
@@ -422,7 +422,7 @@ 				"Bad object name: %s", old_rev);
 			return;
 		}
 	} 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 {
 		hashclr(old_rev_sha1);
 	}
@@ -434,7 +434,7 @@ 			cgit_print_error_page(404, "Not found",
 				"Bad commit: %s", sha1_to_hex(old_rev_sha1));
 			return;
 		}
-		old_tree_sha1 = commit2->tree->object.sha1;
+		old_tree_sha1 = commit2->tree->object.oid.hash;
 	} else {
 		old_tree_sha1 = NULL;
 	}




diff --git a/ui-log.c b/ui-log.c
index 0782478d3b6af207e86f0aff068fe7eb212b91fd..45732550bd7dc68e768862a5cb6c4f2bd03ba660 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -82,14 +82,14 @@ 			if (!ctx.repo->enable_remote_branches)
 				goto next;
 			strncpy(buf, deco->name + 13, sizeof(buf) - 1);
 			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.showmsg, 0);
 		}
 		else {
 			strncpy(buf, deco->name, sizeof(buf) - 1);
 			cgit_commit_link(buf, NULL, "deco", ctx.qry.head,
-					 sha1_to_hex(commit->object.sha1),
+					 oid_to_hex(&commit->object.oid),
 					 ctx.qry.vpath);
 		}
 next:
@@ -148,8 +148,8 @@ 	add_lines = 0;
 	rem_lines = 0;
 
 	DIFF_OPT_SET(&revs->diffopt, RECURSIVE);
-	diff_tree_sha1(parent->tree->object.sha1,
-		       commit->tree->object.sha1,
+	diff_tree_sha1(parent->tree->object.oid.hash,
+		       commit->tree->object.oid.hash,
 		       "", &revs->diffopt);
 	diffcore_std(&revs->diffopt);
 
@@ -233,7 +233,7 @@ 			strcpy(info->subject + i, wrap_symbol);
 		}
 	}
 	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);
 	html("</td><td>");
 	cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");
@@ -269,7 +269,7 @@ 			if (info->msg && *(info->msg)) {
 				strbuf_addstr(&msgbuf, info->msg);
 				strbuf_addch(&msgbuf, '\n');
 			}
-			format_display_notes(commit->object.sha1,
+			format_display_notes(commit->object.oid.hash,
 					     &msgbuf, PAGE_ENCODING, 0);
 			strbuf_addch(&msgbuf, '\n');
 			strbuf_ltrim(&msgbuf);




diff --git a/ui-patch.c b/ui-patch.c
index 430231e20aca1eb8e9a3001c6240638bc572ff98..4c051e8caa200fa30973338f0670cd77d685b975 100644
--- a/ui-patch.c
+++ b/ui-patch.c
@@ -48,7 +48,7 @@ 					"Bad commit reference: %s", old_rev);
 			return;
 		}
 	} 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 {
 		hashclr(old_rev_sha1);
 	}




diff --git a/ui-plain.c b/ui-plain.c
index e4beb997c371a6608e425519fff61c8ef19a3f87..58addab946af588fcb458026f9e7f5f731e6c7f5 100644
--- a/ui-plain.c
+++ b/ui-plain.c
@@ -183,7 +183,7 @@ 	}
 	if (!path_items.match) {
 		path_items.match = "";
 		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;
 	}
 	else




diff --git a/ui-shared.c b/ui-shared.c
index c04f380be52defbcfb2afb9187b61529c24e68ed..48358cc04170df515e23f3a07af6111f0bab7f35 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -525,7 +525,7 @@ void cgit_object_link(struct object *obj)
 {
 	char *page, *shortrev, *fullrev, *name;
 
-	fullrev = sha1_to_hex(obj->sha1);
+	fullrev = oid_to_hex(&obj->oid);
 	shortrev = xstrdup(fullrev);
 	shortrev[10] = '\0';
 	if (obj->type == OBJ_COMMIT) {




diff --git a/ui-tree.c b/ui-tree.c
index d71503da1f7691329946e481434f1998eb811454..3ff2320744b584464e196a25a66fed9be38ee64f 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -287,7 +287,7 @@
 	walk_tree_ctx.curr_rev = xstrdup(rev);
 
 	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;
 	}