diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-02-13 20:08:56 +0000 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-02-13 20:08:56 +0000 |
| commit | 3ba58a5a3cebb2631b0700925e576ace0c2154d0 (patch) | |
| tree | 972bd46641403d9b45947a7f16d25d647ea761d1 | |
| parent | git: update to v2.51.1 (diff) | |
| download | cgit-3ba58a5a3cebb2631b0700925e576ace0c2154d0.tar.gz cgit-3ba58a5a3cebb2631b0700925e576ace0c2154d0.tar.bz2 cgit-3ba58a5a3cebb2631b0700925e576ace0c2154d0.zip | |
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | cgit.c | 7 | ||||
| -rw-r--r-- | cgit.h | 3 | ||||
| m--------- | git | 0 | ||||
| -rw-r--r-- | shared.c | 7 | ||||
| -rw-r--r-- | ui-clone.c | 24 | ||||
| -rw-r--r-- | ui-log.c | 2 | ||||
| -rw-r--r-- | ui-shared.c | 5 | ||||
| -rw-r--r-- | ui-tag.c | 2 |
9 files changed, 24 insertions, 28 deletions
@@ -14,7 +14,7 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = <openssl/sha.h> -GIT_VER = 2.51.0 +GIT_VER = 2.53.0 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz INSTALL = install COPYTREE = cp -r @@ -448,16 +448,15 @@ struct refmatch { int match; }; -static int find_current_ref(const char *refname, const char *referent, - 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; } @@ -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, 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 -Subproject 81f86aacc4eb74cdb9c2c8082d36d2070c66604 +Subproject 453e7b744aef0d9dab62dac6ab030bb643a2e11 @@ -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, 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); @@ -395,7 +394,7 @@ int cgit_parse_snapshots_mask(const char *str) if (strcmp(str, "all") == 0) return INT_MAX; - string_list_split(&tokens, str, ' ', -1); + string_list_split(&tokens, str, " ", -1); string_list_remove_empty_items(&tokens, 0); for_each_string_list_item(item, &tokens) { @@ -15,39 +15,39 @@ #include "ui-shared.h" #include "packfile.h" -static int print_ref_info(const char *refname, const char *referent, 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(); - reprepare_packed_git(the_repository); - for (pack = get_packed_git(the_repository); pack; pack = pack->next) { - if (pack->pack_local) { - offset = strrchr(pack->pack_name, '/'); + odb_reprepare(the_repository->objects); + for (e = packfile_store_get_packs(the_repository->objects->sources->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); } } @@ -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 d3cf24b..476aa4d 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -947,10 +947,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, 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; } @@ -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; |