Author: Christian Hesse <mail@eworm.de>
git: update to v2.19.1 Update to git version v2.19.1. Required changes follow upstream commits: * commit: add repository argument to get_cached_commit_buffer (3ce85f7e5a41116145179f0fae2ce6d86558d099) * commit: add repository argument to lookup_commit_reference (2122f6754c93be8f02bfb5704ed96c88fc9837a8) * object: add repository argument to parse_object (109cd76dd3467bd05f8d2145b857006649741d5c) * tag: add repository argument to deref_tag (a74093da5ed601a09fa158e5ba6f6f14c1142a3e) * tag: add repository argument to lookup_tag (ce71efb713f97f476a2d2ab541a0c73f684a5db3) * tree: add repository argument to lookup_tree (f86bcc7b2ce6cad68ba1a48a528e380c6126705e) * archive.c: avoid access to the_index (b612ee202a48f129f81f8f6a5af6cf71d1a9caef) * for_each_*_object: move declarations to object-store.h (0889aae1cd18c1804ba01c1a4229e516dfb9fe9b) Signed-off-by: Christian Hesse <mail@eworm.de>
Makefile | 2 +- cgit.h | 1 + parsing.c | 2 +- shared.c | 2 +- ui-blame.c | 2 +- ui-blob.c | 6 +++--- ui-clone.c | 4 ++-- ui-commit.c | 4 ++-- ui-diff.c | 4 ++-- ui-patch.c | 4 ++-- ui-plain.c | 2 +- ui-snapshot.c | 4 ++-- ui-tag.c | 4 ++-- ui-tree.c | 4 ++--
diff --git a/Makefile b/Makefile index 05ea71fdba8a2388d4623e3e12fb1b02bfb814b6..1c49b5092a08a22e6dffa9c7811e4392d6f64833 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.18.0 +GIT_VER = 2.19.1 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz INSTALL = install COPYTREE = cp -r diff --git a/cgit.h b/cgit.h index 32dfd7a6b741db6d1b87aa9807bf8a69e5b3f70b..bcc4fce3d6d1f0d891b1dd95c1f353a657f4f098 100644 --- a/cgit.h +++ b/cgit.h @@ -8,6 +8,7 @@ #include <cache.h> #include <grep.h> #include <object.h> +#include <object-store.h> #include <tree.h> #include <commit.h> #include <tag.h> diff --git a/parsing.c b/parsing.c index 9e73e70c3cf909125f7444c7d7f96ea6c87466eb..7b3980e6b1d0dca661183ddfcb45ab491354ce2d 100644 --- a/parsing.c +++ b/parsing.c @@ -129,7 +129,7 @@ struct commitinfo *cgit_parse_commit(struct commit *commit) { const int sha1hex_len = 40; struct commitinfo *ret; - const char *p = get_cached_commit_buffer(commit, NULL); + const char *p = get_cached_commit_buffer(the_repository, commit, NULL); const char *t; ret = xcalloc(1, sizeof(struct commitinfo)); diff --git a/shared.c b/shared.c index 609bd2a30670e5eab7974593fd98c6d9e95c24bc..7560f5f3ea5dd7a0e56afd6c781963447d305960 100644 --- a/shared.c +++ b/shared.c @@ -161,7 +161,7 @@ struct refinfo *ref; ref = xmalloc(sizeof (struct refinfo)); ref->refname = xstrdup(refname); - ref->object = parse_object(oid); + ref->object = parse_object(the_repository, oid); switch (ref->object->type) { case OBJ_TAG: ref->tag = cgit_parse_tag((struct tag *)ref->object); diff --git a/ui-blame.c b/ui-blame.c index 50d05803b4e621f4cefe4e6e67b4a88f887eafa5..6dc555fbd22b52651eda9afd7bcf245e464e37da 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -278,7 +278,7 @@ cgit_print_error_page(404, "Not found", "Invalid revision name: %s", rev); return; } - commit = lookup_commit_reference(&oid); + commit = lookup_commit_reference(the_repository, &oid); if (!commit || parse_commit(commit)) { cgit_print_error_page(404, "Not found", "Invalid commit reference: %s", rev); diff --git a/ui-blob.c b/ui-blob.c index 7b6da2a491b83f08642ba1f32bcadb5d5d0224df..4b6b46277acf12d6f837d29530289568c64442de 100644 --- a/ui-blob.c +++ b/ui-blob.c @@ -56,7 +56,7 @@ if (get_oid(ref, &oid)) goto done; if (oid_object_info(the_repository, &oid, &size) != OBJ_COMMIT) goto done; - read_tree_recursive(lookup_commit_reference(&oid)->maybe_tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx); + read_tree_recursive(lookup_commit_reference(the_repository, &oid)->maybe_tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx); done: free(path_items.match); @@ -89,7 +89,7 @@ if (get_oid(head, &oid)) return -1; type = oid_object_info(the_repository, &oid, &size); if (type == OBJ_COMMIT) { - commit = lookup_commit_reference(&oid); + commit = lookup_commit_reference(the_repository, &oid); read_tree_recursive(commit->maybe_tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx); if (!walk_tree_ctx.found_path) return -1; @@ -145,7 +145,7 @@ type = oid_object_info(the_repository, &oid, &size); if ((!hex) && type == OBJ_COMMIT && path) { - commit = lookup_commit_reference(&oid); + commit = lookup_commit_reference(the_repository, &oid); read_tree_recursive(commit->maybe_tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx); type = oid_object_info(the_repository, &oid, &size); } diff --git a/ui-clone.c b/ui-clone.c index 6ba8f361e6ae63bf13de716a16957c3bbe73f58a..5dccb639761a57f8e3176c52029ab5a5e57194dc 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -19,12 +19,12 @@ int flags, void *cb_data) { struct object *obj; - if (!(obj = parse_object(oid))) + if (!(obj = parse_object(the_repository, oid))) return 0; htmlf("%s\t%s\n", oid_to_hex(oid), refname); if (obj->type == OBJ_TAG) { - if (!(obj = deref_tag(obj, refname, 0))) + if (!(obj = deref_tag(the_repository, obj, refname, 0))) return 0; htmlf("%s\t%s^{}\n", oid_to_hex(&obj->oid), refname); } diff --git a/ui-commit.c b/ui-commit.c index 995cb9345addb03fc4eef95c1004a671d4f00d09..9a47b54c560544cf32e0b797614e04c6606eff80 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -31,7 +31,7 @@ cgit_print_error_page(400, "Bad request", "Bad object id: %s", hex); return; } - commit = lookup_commit_reference(&oid); + commit = lookup_commit_reference(the_repository, &oid); if (!commit) { cgit_print_error_page(404, "Not found", "Bad commit reference: %s", hex); @@ -87,7 +87,7 @@ } free(tmp); html("</td></tr>\n"); for (p = commit->parents; p; p = p->next) { - parent = lookup_commit_reference(&p->item->object.oid); + parent = lookup_commit_reference(the_repository, &p->item->object.oid); if (!parent) { html("<tr><td colspan='3'>"); cgit_print_error("Error reading parent commit"); diff --git a/ui-diff.c b/ui-diff.c index e33e9fb5e1fa46bacaf409fce67d46e13dffd385..70dcc915ddd47117a5f75a1745117018ad24f688 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -407,7 +407,7 @@ cgit_print_error_page(404, "Not found", "Bad object name: %s", new_rev); return; } - commit = lookup_commit_reference(new_rev_oid); + commit = lookup_commit_reference(the_repository, new_rev_oid); if (!commit || parse_commit(commit)) { cgit_print_error_page(404, "Not found", "Bad commit: %s", oid_to_hex(new_rev_oid)); @@ -428,7 +428,7 @@ oidclr(old_rev_oid); } if (!is_null_oid(old_rev_oid)) { - commit2 = lookup_commit_reference(old_rev_oid); + commit2 = lookup_commit_reference(the_repository, old_rev_oid); if (!commit2 || parse_commit(commit2)) { cgit_print_error_page(404, "Not found", "Bad commit: %s", oid_to_hex(old_rev_oid)); diff --git a/ui-patch.c b/ui-patch.c index 82f125b24d27e207373a39e05a764b65947bd1fb..5a964108e51e5f553536899cb6b79922e25e1288 100644 --- a/ui-patch.c +++ b/ui-patch.c @@ -36,7 +36,7 @@ cgit_print_error_page(404, "Not found", "Bad object id: %s", new_rev); return; } - commit = lookup_commit_reference(&new_rev_oid); + commit = lookup_commit_reference(the_repository, &new_rev_oid); if (!commit) { cgit_print_error_page(404, "Not found", "Bad commit reference: %s", new_rev); @@ -49,7 +49,7 @@ cgit_print_error_page(404, "Not found", "Bad object id: %s", old_rev); return; } - if (!lookup_commit_reference(&old_rev_oid)) { + if (!lookup_commit_reference(the_repository, &old_rev_oid)) { cgit_print_error_page(404, "Not found", "Bad commit reference: %s", old_rev); return; diff --git a/ui-plain.c b/ui-plain.c index ddb3e4819f0a9bb2de69923ddf8d0906689fa2b1..070c34bccec5be20feb66379ab0f5ec777b991de 100644 --- a/ui-plain.c +++ b/ui-plain.c @@ -185,7 +185,7 @@ if (get_oid(rev, &oid)) { cgit_print_error_page(404, "Not found", "Not found"); return; } - commit = lookup_commit_reference(&oid); + commit = lookup_commit_reference(the_repository, &oid); if (!commit || parse_commit(commit)) { cgit_print_error_page(404, "Not found", "Not found"); return; diff --git a/ui-snapshot.c b/ui-snapshot.c index fa3ceafe65473a015f4a0ff0e6d97b9dcfc54677..85efe64a0e7f6f41bedbddfe6722fb4db5a6832a 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -37,7 +37,7 @@ nargv = xmalloc(sizeof(char *) * (argv.argc + 1)); /* argv_array guarantees a trailing NULL entry. */ memcpy(nargv, argv.argv, sizeof(char *) * (argv.argc + 1)); - result = write_archive(argv.argc, nargv, NULL, NULL, 0); + result = write_archive(argv.argc, nargv, NULL, the_repository, NULL, 0); argv_array_clear(&argv); free(nargv); return result; @@ -147,7 +147,7 @@ cgit_print_error_page(404, "Not found", "Bad object id: %s", hex); return 1; } - if (!lookup_commit_reference(&oid)) { + if (!lookup_commit_reference(the_repository, &oid)) { cgit_print_error_page(400, "Bad request", "Not a commit reference: %s", hex); return 1; diff --git a/ui-tag.c b/ui-tag.c index 2c96c37efc6cc7be4643b9ecbc5d6031755cf310..f530224661aed0b8e15dd289b504d8d241e2f167 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -53,7 +53,7 @@ cgit_print_error_page(404, "Not found", "Bad tag reference: %s", revname); goto cleanup; } - obj = parse_object(&oid); + obj = parse_object(the_repository, &oid); if (!obj) { cgit_print_error_page(500, "Internal server error", "Bad object id: %s", oid_to_hex(&oid)); @@ -63,7 +63,7 @@ if (obj->type == OBJ_TAG) { struct tag *tag; struct taginfo *info; - tag = lookup_tag(&oid); + tag = lookup_tag(the_repository, &oid); if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) { cgit_print_error_page(500, "Internal server error", "Bad tag object: %s", revname); diff --git a/ui-tree.c b/ui-tree.c index e6b3074faa964e7051674bdf75adcf7dfe85c262..df8ad82ca4914a5b469986545f1543bf1480f511 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -177,7 +177,7 @@ while (tree_ctx.count == 1) { cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head, rev, fullpath->buf); - tree = lookup_tree(&tree_ctx.oid); + tree = lookup_tree(the_repository, &tree_ctx.oid); if (!tree) return; @@ -359,7 +359,7 @@ cgit_print_error_page(404, "Not found", "Invalid revision name: %s", rev); return; } - commit = lookup_commit_reference(&oid); + commit = lookup_commit_reference(the_repository, &oid); if (!commit || parse_commit(commit)) { cgit_print_error_page(404, "Not found", "Invalid commit reference: %s", rev);