From 2c9f56f3e1c754f60ccffbc6c745b9d5a81ea005 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 28 Aug 2018 18:27:00 +0200 Subject: 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 --- ui-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index e6b3074..df8ad82 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -177,7 +177,7 @@ static void write_tree_link(const struct object_id *oid, char *name, 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 @@ void cgit_print_tree(const char *rev, char *path) "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); -- cgit v1.2.3-24-g4f1b From ccba7eb9d0c43ffe99178ab6632dc3794f887309 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 2 Jan 2019 17:25:01 +0100 Subject: global: make 'char *path' const where possible Signed-off-by: Christian Hesse --- ui-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index df8ad82..314ac52 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -84,7 +84,7 @@ static void print_binary_buffer(char *buf, unsigned long size) html("\n"); } -static void print_object(const struct object_id *oid, char *path, const char *basename, const char *rev) +static void print_object(const struct object_id *oid, const char *path, const char *basename, const char *rev) { enum object_type type; char *buf; @@ -279,7 +279,7 @@ static void ls_tail(void) cgit_print_layout_end(); } -static void ls_tree(const struct object_id *oid, char *path, struct walk_tree_context *walk_tree_ctx) +static void ls_tree(const struct object_id *oid, const char *path, struct walk_tree_context *walk_tree_ctx) { struct tree *tree; struct pathspec paths = { -- cgit v1.2.3-24-g4f1b From 985fba80d06f37fdba5e72d738ce21ab5ab5a76d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 24 Feb 2019 21:19:46 +0100 Subject: git: update to v2.21.0 Update to git version v2.21.0. Required changes follow upstream commits: * 6a7895fd8a3bd409f2b71ffc355d5142172cc2a0 (commit: prepare free_commit_buffer and release_commit_memory for any repo) * e092073d643b17c82d72cf692fbfaea9c9796f11 (tree.c: make read_tree*() take 'struct repository *') Signed-off-by: Christian Hesse Reviewed-by: John Keeping --- ui-tree.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index 314ac52..4be89c8 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -185,8 +185,8 @@ static void write_tree_link(const struct object_id *oid, char *name, tree_ctx.name = NULL; tree_ctx.count = 0; - read_tree_recursive(tree, "", 0, 1, &paths, single_tree_cb, - &tree_ctx); + read_tree_recursive(the_repository, tree, "", 0, 1, + &paths, single_tree_cb, &tree_ctx); if (tree_ctx.count != 1) break; @@ -294,7 +294,8 @@ static void ls_tree(const struct object_id *oid, const char *path, struct walk_t } ls_head(); - read_tree_recursive(tree, "", 0, 1, &paths, ls_item, walk_tree_ctx); + read_tree_recursive(the_repository, tree, "", 0, 1, + &paths, ls_item, walk_tree_ctx); ls_tail(); } @@ -373,7 +374,8 @@ void cgit_print_tree(const char *rev, char *path) goto cleanup; } - read_tree_recursive(commit->maybe_tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx); + read_tree_recursive(the_repository, commit->maybe_tree, "", 0, 0, + &paths, walk_tree, &walk_tree_ctx); if (walk_tree_ctx.state == 1) ls_tail(); else if (walk_tree_ctx.state == 2) -- cgit v1.2.3-24-g4f1b From e1ad15d368bdeb1bffea588b93a29055c5dfb7f4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 26 Feb 2019 17:08:31 +0100 Subject: ui-tree: allow per repository override for enable-blame The blame operation can cause high cost in terms of CPU load for huge repositories. Let's add a per repository override for enable-blame. Signed-off-by: Christian Hesse --- ui-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index 4be89c8..84eb17d 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -110,7 +110,7 @@ static void print_object(const struct object_id *oid, const char *path, const ch htmlf("blob: %s (", oid_to_hex(oid)); cgit_plain_link("plain", NULL, NULL, ctx.qry.head, rev, path); - if (ctx.cfg.enable_blame) { + if (ctx.repo->enable_blame) { html(") ("); cgit_blame_link("blame", NULL, NULL, ctx.qry.head, rev, path); @@ -251,7 +251,7 @@ static int ls_item(const struct object_id *oid, struct strbuf *base, if (!S_ISGITLINK(mode)) cgit_plain_link("plain", NULL, "button", ctx.qry.head, walk_tree_ctx->curr_rev, fullpath.buf); - if (!S_ISDIR(mode) && ctx.cfg.enable_blame) + if (!S_ISDIR(mode) && ctx.repo->enable_blame) cgit_blame_link("blame", NULL, "button", ctx.qry.head, walk_tree_ctx->curr_rev, fullpath.buf); html("\n"); -- cgit v1.2.3-24-g4f1b