* [PATCH 1/9] parsing: ban strncpy() @ 2018-08-28 18:38 list 2018-08-28 18:38 ` [PATCH 2/9] parsing: ban sprintf() list ` (7 more replies) 0 siblings, 8 replies; 15+ messages in thread From: list @ 2018-08-28 18:38 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Git upstream bans strncpy() with commit: banned.h: mark strncpy() as banned e488b7aba743d23b830d239dcc33d9ca0745a9ad Signed-off-by: Christian Hesse <mail at eworm.de> --- parsing.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/parsing.c b/parsing.c index 12453c2..e224564 100644 --- a/parsing.c +++ b/parsing.c @@ -63,8 +63,7 @@ static char *substr(const char *head, const char *tail) if (tail < head) return xstrdup(""); buf = xmalloc(tail - head + 1); - strncpy(buf, head, tail - head); - buf[tail - head] = '\0'; + strlcpy(buf, head, tail - head + 1); return buf; } ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 2/9] parsing: ban sprintf() 2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list @ 2018-08-28 18:38 ` list 2018-08-28 18:38 ` [PATCH 3/9] ui-log: ban strcpy() list ` (6 subsequent siblings) 7 siblings, 0 replies; 15+ messages in thread From: list @ 2018-08-28 18:38 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Git upstream bans sprintf() with commit: banned.h: mark sprintf() as banned cc8fdaee1eeaf05d8dd55ff11f111b815f673c58 Signed-off-by: Christian Hesse <mail at eworm.de> --- parsing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsing.c b/parsing.c index e224564..9e73e70 100644 --- a/parsing.c +++ b/parsing.c @@ -77,7 +77,7 @@ static void parse_user(const char *t, char **name, char **email, unsigned long * email_len = ident.mail_end - ident.mail_begin; *email = xmalloc(strlen("<") + email_len + strlen(">") + 1); - sprintf(*email, "<%.*s>", email_len, ident.mail_begin); + xsnprintf(*email, email_len + 3, "<%.*s>", email_len, ident.mail_begin); if (ident.date_begin) *date = strtoul(ident.date_begin, NULL, 10); ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/9] ui-log: ban strcpy() 2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list 2018-08-28 18:38 ` [PATCH 2/9] parsing: ban sprintf() list @ 2018-08-28 18:38 ` list 2018-08-28 18:38 ` [PATCH 4/9] ui-log: ban strncpy() list ` (5 subsequent siblings) 7 siblings, 0 replies; 15+ messages in thread From: list @ 2018-08-28 18:38 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Git upstream bans strcpy() with commit: automatically ban strcpy() c8af66ab8ad7cd78557f0f9f5ef6a52fd46ee6dd Signed-off-by: Christian Hesse <mail at eworm.de> --- ui-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-log.c b/ui-log.c index d696e20..c2f92fe 100644 --- a/ui-log.c +++ b/ui-log.c @@ -234,7 +234,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) strbuf_add(&msgbuf, "\n\n", 2); /* Place wrap_symbol at position i in info->subject */ - strcpy(info->subject + i, wrap_symbol); + strlcpy(info->subject + i, wrap_symbol, subject_len - i + 1); } } cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 4/9] ui-log: ban strncpy() 2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list 2018-08-28 18:38 ` [PATCH 2/9] parsing: ban sprintf() list 2018-08-28 18:38 ` [PATCH 3/9] ui-log: ban strcpy() list @ 2018-08-28 18:38 ` list 2018-08-28 18:38 ` [PATCH 5/9] ui-patch: ban sprintf() list ` (4 subsequent siblings) 7 siblings, 0 replies; 15+ messages in thread From: list @ 2018-08-28 18:38 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Git upstream bans strncpy() with commit: banned.h: mark strncpy() as banned e488b7aba743d23b830d239dcc33d9ca0745a9ad Signed-off-by: Christian Hesse <mail at eworm.de> --- ui-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-log.c b/ui-log.c index c2f92fe..3bcb657 100644 --- a/ui-log.c +++ b/ui-log.c @@ -67,7 +67,7 @@ void show_commit_decorations(struct commit *commit) while (deco) { struct object_id peeled; int is_annotated = 0; - strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1); + strlcpy(buf, prettify_refname(deco->name), sizeof(buf)); switch(deco->type) { case DECORATION_NONE: /* If the git-core doesn't recognize it, ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 5/9] ui-patch: ban sprintf() 2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list ` (2 preceding siblings ...) 2018-08-28 18:38 ` [PATCH 4/9] ui-log: ban strncpy() list @ 2018-08-28 18:38 ` list 2018-08-28 18:38 ` [PATCH 6/9] ui-shared: ban strcat() list ` (3 subsequent siblings) 7 siblings, 0 replies; 15+ messages in thread From: list @ 2018-08-28 18:38 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Git upstream bans sprintf() with commit: banned.h: mark sprintf() as banned cc8fdaee1eeaf05d8dd55ff11f111b815f673c58 Signed-off-by: Christian Hesse <mail at eworm.de> --- ui-patch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui-patch.c b/ui-patch.c index 8007a11..82f125b 100644 --- a/ui-patch.c +++ b/ui-patch.c @@ -11,13 +11,16 @@ #include "html.h" #include "ui-shared.h" +/* two commit hashes with two dots in between and termination */ +#define REV_RANGE_LEN 2 * GIT_MAX_HEXSZ + 3 + void cgit_print_patch(const char *new_rev, const char *old_rev, const char *prefix) { struct rev_info rev; struct commit *commit; struct object_id new_rev_oid, old_rev_oid; - char rev_range[2 * 40 + 3]; + char rev_range[REV_RANGE_LEN]; const char *rev_argv[] = { NULL, "--reverse", "--format=email", rev_range, "--", prefix, NULL }; int rev_argc = ARRAY_SIZE(rev_argv) - 1; char *patchname; @@ -60,7 +63,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, if (is_null_oid(&old_rev_oid)) { memcpy(rev_range, oid_to_hex(&new_rev_oid), GIT_SHA1_HEXSZ + 1); } else { - sprintf(rev_range, "%s..%s", oid_to_hex(&old_rev_oid), + xsnprintf(rev_range, REV_RANGE_LEN, "%s..%s", oid_to_hex(&old_rev_oid), oid_to_hex(&new_rev_oid)); } ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 6/9] ui-shared: ban strcat() 2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list ` (3 preceding siblings ...) 2018-08-28 18:38 ` [PATCH 5/9] ui-patch: ban sprintf() list @ 2018-08-28 18:38 ` list 2018-08-28 18:38 ` [PATCH 7/9] ui-ssdiff: ban strncpy() list ` (2 subsequent siblings) 7 siblings, 0 replies; 15+ messages in thread From: list @ 2018-08-28 18:38 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Git upstream bans strcat() with commit: banned.h: mark strcat() as banned 1b11b64b815db62f93a04242e4aed5687a448748 To avoid compiler warnings from gcc 8.1.x we get the hard way. Signed-off-by: Christian Hesse <mail at eworm.de> --- ui-shared.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ui-shared.c b/ui-shared.c index 739505a..b53c56d 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1159,7 +1159,7 @@ void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref, void cgit_set_title_from_path(const char *path) { - size_t path_len, path_index, path_last_end; + size_t path_len, path_index, path_last_end, line_len; char *new_title; if (!path) @@ -1176,14 +1176,18 @@ void cgit_set_title_from_path(const char *path) continue; } strncat(new_title, &path[path_index + 1], path_last_end - path_index - 1); - strcat(new_title, "\\"); + line_len = strlen(new_title); + new_title[line_len++] = '\\'; + new_title[line_len] = '\0'; path_last_end = path_index; } } if (path_last_end) strncat(new_title, path, path_last_end); - strcat(new_title, " - "); - strcat(new_title, ctx.page.title); + line_len = strlen(new_title); + memcpy(&new_title[line_len], " - ", 3); + new_title[line_len + 3] = '\0'; + strncat(new_title, ctx.page.title, sizeof(new_title) - strlen(new_title) - 1); ctx.page.title = new_title; } ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 7/9] ui-ssdiff: ban strncpy() 2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list ` (4 preceding siblings ...) 2018-08-28 18:38 ` [PATCH 6/9] ui-shared: ban strcat() list @ 2018-08-28 18:38 ` list 2018-08-28 18:38 ` [PATCH 8/9] ui-ssdiff: ban strcat() list 2018-08-28 18:38 ` [PATCH 9/9] RFC: git: update to v2.19.0-rc0 list 7 siblings, 0 replies; 15+ messages in thread From: list @ 2018-08-28 18:38 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Git upstream bans strncpy() with commit: banned.h: mark strncpy() as banned e488b7aba743d23b830d239dcc33d9ca0745a9ad Signed-off-by: Christian Hesse <mail at eworm.de> --- ui-ssdiff.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui-ssdiff.c b/ui-ssdiff.c index 68c2044..a3dd059 100644 --- a/ui-ssdiff.c +++ b/ui-ssdiff.c @@ -103,8 +103,7 @@ static int line_from_hunk(char *line, char type) return 0; len = buf2 - buf1; buf2 = xmalloc(len + 1); - strncpy(buf2, buf1, len); - buf2[len] = '\0'; + strlcpy(buf2, buf1, len + 1); res = atoi(buf2); free(buf2); return res; ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 8/9] ui-ssdiff: ban strcat() 2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list ` (5 preceding siblings ...) 2018-08-28 18:38 ` [PATCH 7/9] ui-ssdiff: ban strncpy() list @ 2018-08-28 18:38 ` list 2018-08-28 18:38 ` [PATCH 9/9] RFC: git: update to v2.19.0-rc0 list 7 siblings, 0 replies; 15+ messages in thread From: list @ 2018-08-28 18:38 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Git upstream bans strcat() with commit: banned.h: mark strcat() as banned 1b11b64b815db62f93a04242e4aed5687a448748 Signed-off-by: Christian Hesse <mail at eworm.de> --- ui-ssdiff.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui-ssdiff.c b/ui-ssdiff.c index a3dd059..c456033 100644 --- a/ui-ssdiff.c +++ b/ui-ssdiff.c @@ -117,6 +117,7 @@ static char *replace_tabs(char *line) int n_tabs = 0; int i; char *result; + int result_len; if (linelen == 0) { result = xmalloc(1); @@ -128,13 +129,14 @@ static char *replace_tabs(char *line) if (line[i] == '\t') n_tabs += 1; } - result = xmalloc(linelen + n_tabs * 8 + 1); + result_len = linelen + n_tabs * 8; + result = xmalloc(result_len + 1); result[0] = '\0'; for (;;) { cur_buf = strchr(prev_buf, '\t'); if (!cur_buf) { - strcat(result, prev_buf); + strncat(result, prev_buf, result_len); break; } else { strncat(result, prev_buf, cur_buf - prev_buf); ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 9/9] RFC: git: update to v2.19.0-rc0 2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list ` (6 preceding siblings ...) 2018-08-28 18:38 ` [PATCH 8/9] ui-ssdiff: ban strcat() list @ 2018-08-28 18:38 ` list 2018-08-28 20:13 ` [PATCH 1/1] RFC: git: update to v2.19.0-rc1 list 7 siblings, 1 reply; 15+ messages in thread From: list @ 2018-08-28 18:38 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Update to git version v2.19.0-rc0. 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 at eworm.de> --- Makefile | 4 ++-- cgit.h | 1 + git | 2 +- 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 ++-- 15 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 05ea71f..d67c8c6 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = <openssl/sha.h> -GIT_VER = 2.18.0 -GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz +GIT_VER = 2.19.0.rc0 +GIT_URL = https://www.kernel.org/pub/software/scm/git/testing/git-$(GIT_VER).tar.gz INSTALL = install COPYTREE = cp -r MAN5_TXT = $(wildcard *.5.txt) diff --git a/cgit.h b/cgit.h index 32dfd7a..bcc4fce 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/git b/git index 53f9a3e..7e8bfb0 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 53f9a3e157dbbc901a02ac2c73346d375e24978c +Subproject commit 7e8bfb0412581daf8f3c89909f1d37844e8610dd diff --git a/parsing.c b/parsing.c index 9e73e70..7b3980e 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 609bd2a..7560f5f 100644 --- a/shared.c +++ b/shared.c @@ -161,7 +161,7 @@ static struct refinfo *cgit_mk_refinfo(const char *refname, const struct object_ 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 50d0580..6dc555f 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -278,7 +278,7 @@ void cgit_print_blame(void) "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 7b6da2a..4b6b462 100644 --- a/ui-blob.c +++ b/ui-blob.c @@ -56,7 +56,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only) 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 @@ int cgit_print_file(char *path, const char *head, int file_only) 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 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl 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 6ba8f36..5dccb63 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -19,12 +19,12 @@ static int print_ref_info(const char *refname, const struct object_id *oid, { 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 995cb93..9a47b54 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -31,7 +31,7 @@ void cgit_print_commit(char *hex, const char *prefix) "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 @@ void cgit_print_commit(char *hex, const char *prefix) 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 e33e9fb..70dcc91 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -407,7 +407,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, } 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 82f125b..5a96410 100644 --- a/ui-patch.c +++ b/ui-patch.c @@ -36,7 +36,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 ddb3e48..070c34b 100644 --- a/ui-plain.c +++ b/ui-plain.c @@ -185,7 +185,7 @@ void cgit_print_plain(void) 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 fa3ceaf..85efe64 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -37,7 +37,7 @@ static int write_archive_type(const char *format, const char *hex, const char *p /* 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 @@ static int make_snapshot(const struct cgit_snapshot_format *format, "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 2c96c37..f530224 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -53,7 +53,7 @@ void cgit_print_tag(char *revname) "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 @@ void cgit_print_tag(char *revname) 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 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); ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/1] RFC: git: update to v2.19.0-rc1 2018-08-28 18:38 ` [PATCH 9/9] RFC: git: update to v2.19.0-rc0 list @ 2018-08-28 20:13 ` list 2018-09-05 6:44 ` [PATCH 1/1] RFC: git: update to v2.19.0-rc2 list 0 siblings, 1 reply; 15+ messages in thread From: list @ 2018-08-28 20:13 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Update to git version v2.19.0-rc1. 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 at eworm.de> --- Makefile | 4 ++-- cgit.h | 1 + git | 2 +- 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 ++-- 15 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 05ea71f..b7477fc 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = <openssl/sha.h> -GIT_VER = 2.18.0 -GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz +GIT_VER = 2.19.0.rc1 +GIT_URL = https://www.kernel.org/pub/software/scm/git/testing/git-$(GIT_VER).tar.gz INSTALL = install COPYTREE = cp -r MAN5_TXT = $(wildcard *.5.txt) diff --git a/cgit.h b/cgit.h index 32dfd7a..bcc4fce 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/git b/git index 53f9a3e..2f74393 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 53f9a3e157dbbc901a02ac2c73346d375e24978c +Subproject commit 2f743933341f276111103550fbf383a34dfcfd38 diff --git a/parsing.c b/parsing.c index 9e73e70..7b3980e 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 609bd2a..7560f5f 100644 --- a/shared.c +++ b/shared.c @@ -161,7 +161,7 @@ static struct refinfo *cgit_mk_refinfo(const char *refname, const struct object_ 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 50d0580..6dc555f 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -278,7 +278,7 @@ void cgit_print_blame(void) "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 7b6da2a..4b6b462 100644 --- a/ui-blob.c +++ b/ui-blob.c @@ -56,7 +56,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only) 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 @@ int cgit_print_file(char *path, const char *head, int file_only) 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 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl 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 6ba8f36..5dccb63 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -19,12 +19,12 @@ static int print_ref_info(const char *refname, const struct object_id *oid, { 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 995cb93..9a47b54 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -31,7 +31,7 @@ void cgit_print_commit(char *hex, const char *prefix) "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 @@ void cgit_print_commit(char *hex, const char *prefix) 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 e33e9fb..70dcc91 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -407,7 +407,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, } 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 82f125b..5a96410 100644 --- a/ui-patch.c +++ b/ui-patch.c @@ -36,7 +36,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 ddb3e48..070c34b 100644 --- a/ui-plain.c +++ b/ui-plain.c @@ -185,7 +185,7 @@ void cgit_print_plain(void) 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 fa3ceaf..85efe64 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -37,7 +37,7 @@ static int write_archive_type(const char *format, const char *hex, const char *p /* 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 @@ static int make_snapshot(const struct cgit_snapshot_format *format, "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 2c96c37..f530224 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -53,7 +53,7 @@ void cgit_print_tag(char *revname) "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 @@ void cgit_print_tag(char *revname) 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 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); ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/1] RFC: git: update to v2.19.0-rc2 2018-08-28 20:13 ` [PATCH 1/1] RFC: git: update to v2.19.0-rc1 list @ 2018-09-05 6:44 ` list 2018-09-10 21:16 ` [PATCH 1/1] git: update to v2.19.0 list 0 siblings, 1 reply; 15+ messages in thread From: list @ 2018-09-05 6:44 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Update to git version v2.19.0-rc2. 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 at eworm.de> --- Makefile | 4 ++-- cgit.h | 1 + git | 2 +- 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 ++-- 15 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 05ea71f..1e8ec14 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = <openssl/sha.h> -GIT_VER = 2.18.0 -GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz +GIT_VER = 2.19.0.rc2 +GIT_URL = https://www.kernel.org/pub/software/scm/git/testing/git-$(GIT_VER).tar.gz INSTALL = install COPYTREE = cp -r MAN5_TXT = $(wildcard *.5.txt) diff --git a/cgit.h b/cgit.h index 32dfd7a..bcc4fce 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/git b/git index 53f9a3e..c05048d 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 53f9a3e157dbbc901a02ac2c73346d375e24978c +Subproject commit c05048d43925ab8edcb36663752c2b4541911231 diff --git a/parsing.c b/parsing.c index 9e73e70..7b3980e 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 609bd2a..7560f5f 100644 --- a/shared.c +++ b/shared.c @@ -161,7 +161,7 @@ static struct refinfo *cgit_mk_refinfo(const char *refname, const struct object_ 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 50d0580..6dc555f 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -278,7 +278,7 @@ void cgit_print_blame(void) "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 7b6da2a..4b6b462 100644 --- a/ui-blob.c +++ b/ui-blob.c @@ -56,7 +56,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only) 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 @@ int cgit_print_file(char *path, const char *head, int file_only) 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 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl 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 6ba8f36..5dccb63 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -19,12 +19,12 @@ static int print_ref_info(const char *refname, const struct object_id *oid, { 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 995cb93..9a47b54 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -31,7 +31,7 @@ void cgit_print_commit(char *hex, const char *prefix) "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 @@ void cgit_print_commit(char *hex, const char *prefix) 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 e33e9fb..70dcc91 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -407,7 +407,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, } 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 82f125b..5a96410 100644 --- a/ui-patch.c +++ b/ui-patch.c @@ -36,7 +36,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 ddb3e48..070c34b 100644 --- a/ui-plain.c +++ b/ui-plain.c @@ -185,7 +185,7 @@ void cgit_print_plain(void) 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 fa3ceaf..85efe64 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -37,7 +37,7 @@ static int write_archive_type(const char *format, const char *hex, const char *p /* 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 @@ static int make_snapshot(const struct cgit_snapshot_format *format, "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 2c96c37..f530224 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -53,7 +53,7 @@ void cgit_print_tag(char *revname) "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 @@ void cgit_print_tag(char *revname) 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 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); ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/1] git: update to v2.19.0 2018-09-05 6:44 ` [PATCH 1/1] RFC: git: update to v2.19.0-rc2 list @ 2018-09-10 21:16 ` list 2018-09-11 0:57 ` Jason 2018-10-12 21:08 ` [PATCH 1/1] git: update to v2.19.1 list 0 siblings, 2 replies; 15+ messages in thread From: list @ 2018-09-10 21:16 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> Update to git version v2.19.0. 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 at eworm.de> --- Makefile | 2 +- cgit.h | 1 + git | 2 +- 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 ++-- 15 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 05ea71f..fc7724f 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.0 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 32dfd7a..bcc4fce 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/git b/git index 53f9a3e..1d4361b 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 53f9a3e157dbbc901a02ac2c73346d375e24978c +Subproject commit 1d4361b0f344188ab5eec6dcea01f61a3a3a1670 diff --git a/parsing.c b/parsing.c index 9e73e70..7b3980e 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 609bd2a..7560f5f 100644 --- a/shared.c +++ b/shared.c @@ -161,7 +161,7 @@ static struct refinfo *cgit_mk_refinfo(const char *refname, const struct object_ 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 50d0580..6dc555f 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -278,7 +278,7 @@ void cgit_print_blame(void) "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 7b6da2a..4b6b462 100644 --- a/ui-blob.c +++ b/ui-blob.c @@ -56,7 +56,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only) 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 @@ int cgit_print_file(char *path, const char *head, int file_only) 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 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl 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 6ba8f36..5dccb63 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -19,12 +19,12 @@ static int print_ref_info(const char *refname, const struct object_id *oid, { 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 995cb93..9a47b54 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -31,7 +31,7 @@ void cgit_print_commit(char *hex, const char *prefix) "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 @@ void cgit_print_commit(char *hex, const char *prefix) 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 e33e9fb..70dcc91 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -407,7 +407,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, } 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 82f125b..5a96410 100644 --- a/ui-patch.c +++ b/ui-patch.c @@ -36,7 +36,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 ddb3e48..070c34b 100644 --- a/ui-plain.c +++ b/ui-plain.c @@ -185,7 +185,7 @@ void cgit_print_plain(void) 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 fa3ceaf..85efe64 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -37,7 +37,7 @@ static int write_archive_type(const char *format, const char *hex, const char *p /* 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 @@ static int make_snapshot(const struct cgit_snapshot_format *format, "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 2c96c37..f530224 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -53,7 +53,7 @@ void cgit_print_tag(char *revname) "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 @@ void cgit_print_tag(char *revname) 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 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); ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/1] git: update to v2.19.0 2018-09-10 21:16 ` [PATCH 1/1] git: update to v2.19.0 list @ 2018-09-11 0:57 ` Jason 2018-09-11 6:48 ` list 2018-10-12 21:08 ` [PATCH 1/1] git: update to v2.19.1 list 1 sibling, 1 reply; 15+ messages in thread From: Jason @ 2018-09-11 0:57 UTC (permalink / raw) Thanks Christian. Feel free to queue this all up in a for-jason branch. ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/1] git: update to v2.19.0 2018-09-11 0:57 ` Jason @ 2018-09-11 6:48 ` list 0 siblings, 0 replies; 15+ messages in thread From: list @ 2018-09-11 6:48 UTC (permalink / raw) "Jason A. Donenfeld" <Jason at zx2c4.com> on Mon, 2018/09/10 18:57: > Thanks Christian. Feel free to queue this all up in a for-jason branch. Done. -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];) putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);} -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20180911/71328c1f/attachment.asc> ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/1] git: update to v2.19.1 2018-09-10 21:16 ` [PATCH 1/1] git: update to v2.19.0 list 2018-09-11 0:57 ` Jason @ 2018-10-12 21:08 ` list 1 sibling, 0 replies; 15+ messages in thread From: list @ 2018-10-12 21:08 UTC (permalink / raw) From: Christian Hesse <mail at eworm.de> 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 at eworm.de> --- Makefile | 2 +- cgit.h | 1 + git | 2 +- 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 ++-- 15 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 05ea71f..1c49b50 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 32dfd7a..bcc4fce 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/git b/git index 53f9a3e..cae598d 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 53f9a3e157dbbc901a02ac2c73346d375e24978c +Subproject commit cae598d9980661a978e2df4fb338518f7bf09572 diff --git a/parsing.c b/parsing.c index 9e73e70..7b3980e 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 609bd2a..7560f5f 100644 --- a/shared.c +++ b/shared.c @@ -161,7 +161,7 @@ static struct refinfo *cgit_mk_refinfo(const char *refname, const struct object_ 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 50d0580..6dc555f 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -278,7 +278,7 @@ void cgit_print_blame(void) "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 7b6da2a..4b6b462 100644 --- a/ui-blob.c +++ b/ui-blob.c @@ -56,7 +56,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only) 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 @@ int cgit_print_file(char *path, const char *head, int file_only) 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 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl 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 6ba8f36..5dccb63 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -19,12 +19,12 @@ static int print_ref_info(const char *refname, const struct object_id *oid, { 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 995cb93..9a47b54 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -31,7 +31,7 @@ void cgit_print_commit(char *hex, const char *prefix) "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 @@ void cgit_print_commit(char *hex, const char *prefix) 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 e33e9fb..70dcc91 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -407,7 +407,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, } 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 82f125b..5a96410 100644 --- a/ui-patch.c +++ b/ui-patch.c @@ -36,7 +36,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, "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 ddb3e48..070c34b 100644 --- a/ui-plain.c +++ b/ui-plain.c @@ -185,7 +185,7 @@ void cgit_print_plain(void) 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 fa3ceaf..85efe64 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -37,7 +37,7 @@ static int write_archive_type(const char *format, const char *hex, const char *p /* 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 @@ static int make_snapshot(const struct cgit_snapshot_format *format, "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 2c96c37..f530224 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -53,7 +53,7 @@ void cgit_print_tag(char *revname) "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 @@ void cgit_print_tag(char *revname) 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 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); ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2018-10-12 21:08 UTC | newest] Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-08-28 18:38 [PATCH 1/9] parsing: ban strncpy() list 2018-08-28 18:38 ` [PATCH 2/9] parsing: ban sprintf() list 2018-08-28 18:38 ` [PATCH 3/9] ui-log: ban strcpy() list 2018-08-28 18:38 ` [PATCH 4/9] ui-log: ban strncpy() list 2018-08-28 18:38 ` [PATCH 5/9] ui-patch: ban sprintf() list 2018-08-28 18:38 ` [PATCH 6/9] ui-shared: ban strcat() list 2018-08-28 18:38 ` [PATCH 7/9] ui-ssdiff: ban strncpy() list 2018-08-28 18:38 ` [PATCH 8/9] ui-ssdiff: ban strcat() list 2018-08-28 18:38 ` [PATCH 9/9] RFC: git: update to v2.19.0-rc0 list 2018-08-28 20:13 ` [PATCH 1/1] RFC: git: update to v2.19.0-rc1 list 2018-09-05 6:44 ` [PATCH 1/1] RFC: git: update to v2.19.0-rc2 list 2018-09-10 21:16 ` [PATCH 1/1] git: update to v2.19.0 list 2018-09-11 0:57 ` Jason 2018-09-11 6:48 ` list 2018-10-12 21:08 ` [PATCH 1/1] git: update to v2.19.1 list
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).