From: Christian Hesse <[email protected]> Update to git version v2.53.0-rc0, this requires changes for these upstream commits:
* bdbebe5714b25dc9d215b48efbb80f410925d7dd refs: introduce wrapper struct for `each_ref_fn` * 589127caa73090040200989ff4d24c3d54f473f2 packfile: move list of packs into the packfile store * 5a5c7359f77ecd1bc4b0e172563161d602f131d3 refs: drop `current_ref_iter` hack * b6e4cc8c32850315323961659e553d1d14591f7f tag: support arbitrary repositories in parse_tag() Signed-off-by: Christian Hesse <[email protected]> --- Makefile | 4 ++-- cgit.c | 7 +++---- cgit.h | 3 +-- git | 2 +- shared.c | 5 ++--- ui-clone.c | 22 +++++++++++----------- ui-log.c | 2 +- ui-shared.c | 5 ++--- ui-tag.c | 2 +- 9 files changed, 24 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index c376d2f..7e3f87c 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.52.0 -GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz +GIT_VER = 2.53.0.rc0 +GIT_URL = https://www.kernel.org/pub/software/scm/git/testing/git-$(GIT_VER).tar.xz INSTALL = install COPYTREE = cp -r MAN5_TXT = $(wildcard *.5.txt) diff --git a/cgit.c b/cgit.c index 65c38c0..579db64 100644 --- a/cgit.c +++ b/cgit.c @@ -448,16 +448,15 @@ struct refmatch { int match; }; -static int find_current_ref(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data) +static int find_current_ref(const struct reference *ref, void *cb_data) { struct refmatch *info; info = (struct refmatch *)cb_data; - if (!strcmp(refname, info->req_ref)) + if (!strcmp(ref->name, info->req_ref)) info->match = 1; if (!info->first_ref) - info->first_ref = xstrdup(refname); + info->first_ref = xstrdup(ref->name); return info->match; } diff --git a/cgit.h b/cgit.h index 653ec28..28d2772 100644 --- a/cgit.h +++ b/cgit.h @@ -346,8 +346,7 @@ extern void strbuf_ensure_end(struct strbuf *sb, char c); extern void cgit_add_ref(struct reflist *list, struct refinfo *ref); extern void cgit_free_reflist_inner(struct reflist *list); -extern int cgit_refs_cb(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data); +extern int cgit_refs_cb(const struct reference *ref, void *cb_data); extern void cgit_free_commitinfo(struct commitinfo *info); extern void cgit_free_taginfo(struct taginfo *info); diff --git a/git b/git index 9a2fb14..7264e61 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed +Subproject commit 7264e61d87e58b9d0f5e6424c47c11e9657dfb75 diff --git a/shared.c b/shared.c index 401cf86..07b38ba 100644 --- a/shared.c +++ b/shared.c @@ -212,11 +212,10 @@ void cgit_free_reflist_inner(struct reflist *list) free(list->refs); } -int cgit_refs_cb(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data) +int cgit_refs_cb(const struct reference *ref, void *cb_data) { struct reflist *list = (struct reflist *)cb_data; - struct refinfo *info = cgit_mk_refinfo(refname, oid); + struct refinfo *info = cgit_mk_refinfo(ref->name, ref->oid); if (info) cgit_add_ref(list, info); diff --git a/ui-clone.c b/ui-clone.c index 9445454..027eb56 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -15,39 +15,39 @@ #include "ui-shared.h" #include "packfile.h" -static int print_ref_info(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data) +static int print_ref_info(const struct reference *ref, void *cb_data) { struct object *obj; - if (!(obj = parse_object(the_repository, oid))) + if (!(obj = parse_object(the_repository, ref->oid))) return 0; - htmlf("%s\t%s\n", oid_to_hex(oid), refname); + htmlf("%s\t%s\n", oid_to_hex(ref->oid), ref->name); if (obj->type == OBJ_TAG) { - if (!(obj = deref_tag(the_repository, obj, refname, 0))) + if (!(obj = deref_tag(the_repository, obj, ref->name, 0))) return 0; - htmlf("%s\t%s^{}\n", oid_to_hex(&obj->oid), refname); + htmlf("%s\t%s^{}\n", oid_to_hex(&obj->oid), ref->name); } return 0; } static void print_pack_info(void) { - struct packed_git *pack; + struct packfile_list_entry *e; char *offset; ctx.page.mimetype = "text/plain"; ctx.page.filename = "objects/info/packs"; cgit_print_http_headers(); odb_reprepare(the_repository->objects); - for (pack = packfile_store_get_packs(the_repository->objects->packfiles); pack; pack = pack->next) { - if (pack->pack_local) { - offset = strrchr(pack->pack_name, '/'); + for (e = packfile_store_get_packs(the_repository->objects->packfiles); e; e = e->next) { + struct packed_git *p = e->pack; + if (p->pack_local) { + offset = strrchr(p->pack_name, '/'); if (offset && offset[1] != '\0') ++offset; else - offset = pack->pack_name; + offset = p->pack_name; htmlf("P %s\n", offset); } } diff --git a/ui-log.c b/ui-log.c index ee2a607..31fb783 100644 --- a/ui-log.c +++ b/ui-log.c @@ -83,7 +83,7 @@ void show_commit_decorations(struct commit *commit) break; case DECORATION_REF_TAG: if (!refs_read_ref(get_main_ref_store(the_repository), deco->name, &oid_tag) && - !peel_iterated_oid(the_repository, &oid_tag, &peeled)) + !peel_object(the_repository, &oid_tag, &peeled, PEEL_OBJECT_VERIFY_TAGGED_OBJECT_TYPE)) is_annotated = !oideq(&oid_tag, &peeled); cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf); break; diff --git a/ui-shared.c b/ui-shared.c index 4250b89..838170a 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -936,10 +936,9 @@ void cgit_add_clone_urls(void (*fn)(const char *)) add_clone_urls(fn, ctx.cfg.clone_prefix, ctx.repo->url); } -static int print_branch_option(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data) +static int print_branch_option(const struct reference *ref, void *cb_data) { - char *name = (char *)refname; + char *name = (char *)ref->name; html_option(name, name, ctx.qry.head); return 0; } diff --git a/ui-tag.c b/ui-tag.c index 3b11226..8f58f14 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -66,7 +66,7 @@ void cgit_print_tag(char *revname) struct taginfo *info; tag = lookup_tag(the_repository, &oid); - if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) { + if (!tag || parse_tag(the_repository, tag) || !(info = cgit_parse_tag(tag))) { cgit_print_error_page(500, "Internal server error", "Bad tag object: %s", revname); goto cleanup;
