]> gitweb.ps.run Git - ps-cgit/commitdiff
git: update to v2.46.0 main
authorChristian Hesse <mail@eworm.de>
Tue, 16 Jul 2024 07:45:13 +0000 (09:45 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 2 Aug 2024 16:22:56 +0000 (18:22 +0200)
Update to git version v2.46.0, this requires changes for these
upstream commits:

e7da9385708accf518a80a1e17969020fb361048
  global: introduce `USE_THE_REPOSITORY_VARIABLE` macro

9da95bda74cf10e1475384a71fd20914c3b99784
  hash: require hash algorithm in `oidread()` and `oidclr()`

30aaff437fddd889ba429b50b96ea4c151c502c5
  refs: pass repo when peeling objects

c8f815c2083c4b340d4148a15d45c55f2fcc7d3f
  refs: remove functions without ref store

Signed-off-by: Christian Hesse <mail@eworm.de>
20 files changed:
Makefile
cgit.c
git
parsing.c
shared.c
ui-atom.c
ui-blame.c
ui-blob.c
ui-clone.c
ui-commit.c
ui-diff.c
ui-log.c
ui-patch.c
ui-plain.c
ui-refs.c
ui-shared.c
ui-snapshot.c
ui-stats.c
ui-tag.c
ui-tree.c

index 1eb64ea3d42a2e38286c75b43c1f338b11622e42..7f8a5cb0c01a5715cf09e4bef84e28071c6b115d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
 pdfdir = $(docdir)
 mandir = $(prefix)/share/man
 SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.45.2
+GIT_VER = 2.46.0
 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
 INSTALL = install
 COPYTREE = cp -r
diff --git a/cgit.c b/cgit.c
index e61629237cac22d9de48cf3316873cd7d0f586d4..2efa96235a5ffb2552209800e5d40392ca05a1c3 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "cache.h"
 #include "cmd.h"
@@ -473,7 +475,8 @@ static char *find_default_branch(struct cgit_repo *repo)
        info.req_ref = repo->defbranch;
        info.first_ref = NULL;
        info.match = 0;
-       for_each_branch_ref(find_current_ref, &info);
+       refs_for_each_branch_ref(get_main_ref_store(the_repository),
+                                find_current_ref, &info);
        if (info.match)
                ref = info.req_ref;
        else
@@ -490,7 +493,8 @@ static char *guess_defbranch(void)
        const char *ref, *refname;
        struct object_id oid;
 
-       ref = resolve_ref_unsafe("HEAD", 0, &oid, NULL);
+       ref = refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
+                                    "HEAD", 0, &oid, NULL);
        if (!ref || !skip_prefix(ref, "refs/heads/", &refname))
                return "master";
        return xstrdup(refname);
diff --git a/git b/git
index bea9ecd24b0c3bf06cab4a851694fe09e7e51408..39bf06adf96da25b87c9aa7d35a32ef3683eb4a4 160000 (submodule)
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit bea9ecd24b0c3bf06cab4a851694fe09e7e51408
+Subproject commit 39bf06adf96da25b87c9aa7d35a32ef3683eb4a4
index dc44ffde3ae5000f4297b866484db99ddaa97c72..5616d4331ebb89c20f940c4f2c1e8f00758c3b0b 100644 (file)
--- a/parsing.c
+++ b/parsing.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 
 /*
index 26b6ddb3297470e4dc4480fac541978f7d813990..ae3f6c131adfbaf14dccfd91ae9ec9db797f9849 100644 (file)
--- a/shared.c
+++ b/shared.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 
 struct cgit_repolist cgit_repolist;
index 636cb7ebb55d28e96952552a3e71b5b6c5d41ebc..0659e96dc9d3f5124eba39c6b15a7a5f2ee440ff 100644 (file)
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-atom.h"
 #include "html.h"
index e0f0593f437137a5ddd5a37bfb7c4f305e3eef15..d07b67f3dccce4ba9267fb97d2ebbf4b352d3a18 100644 (file)
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-blame.h"
 #include "html.h"
index 08f94ee97eb30674887331d8eaed99e68b3b2f73..e554fe9c45f1e489c3109ec38204542e8cde2817 100644 (file)
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-blob.h"
 #include "html.h"
index 5dccb639761a57f8e3176c52029ab5a5e57194dc..df196a04614cc5a9aae44e8beb8b2398d3c88c80 100644 (file)
@@ -7,6 +7,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-clone.h"
 #include "html.h"
@@ -87,7 +89,8 @@ void cgit_clone_info(void)
        ctx.page.mimetype = "text/plain";
        ctx.page.filename = "info/refs";
        cgit_print_http_headers();
-       for_each_ref(print_ref_info, NULL);
+       refs_for_each_ref(get_main_ref_store(the_repository),
+                         print_ref_info, NULL);
 }
 
 void cgit_clone_objects(void)
index 30672d0130a03739fb6f81ff1f079009664c7a94..972e9bc40ab083b2eacba00e9c05116562b02110 100644 (file)
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-commit.h"
 #include "html.h"
index 6f42dd4fc8600c682dde5b819e6885e8e0754fdc..a8245467ae4142668deb3c6335a55f5668aff375 100644 (file)
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-diff.h"
 #include "html.h"
@@ -424,7 +426,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
        } else if (commit->parents && commit->parents->item) {
                oidcpy(old_rev_oid, &commit->parents->item->object.oid);
        } else {
-               oidclr(old_rev_oid);
+               oidclr(old_rev_oid, the_repository->hash_algo);
        }
 
        if (!is_null_oid(old_rev_oid)) {
index 50d479d87343dc81ecb7d02a22696b19037380db..ee2a60765103ce8c21c6c98c356092aa9d624962 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-log.h"
 #include "html.h"
@@ -80,7 +82,8 @@ void show_commit_decorations(struct commit *commit)
                                ctx.qry.showmsg, 0);
                        break;
                case DECORATION_REF_TAG:
-                       if (!read_ref(deco->name, &oid_tag) && !peel_iterated_oid(&oid_tag, &peeled))
+                       if (!refs_read_ref(get_main_ref_store(the_repository), deco->name, &oid_tag) &&
+                           !peel_iterated_oid(the_repository, &oid_tag, &peeled))
                                is_annotated = !oideq(&oid_tag, &peeled);
                        cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf);
                        break;
index 3819a8152ad2e7a4a7230683a08b80ba5f78d713..f9d2eebbda39a63e3d2b82bd2b6534e6d4403366 100644 (file)
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-patch.h"
 #include "html.h"
@@ -57,7 +59,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
        } else if (commit->parents && commit->parents->item) {
                oidcpy(&old_rev_oid, &commit->parents->item->object.oid);
        } else {
-               oidclr(&old_rev_oid);
+               oidclr(&old_rev_oid, the_repository->hash_algo);
        }
 
        if (is_null_oid(&old_rev_oid)) {
index a66c5a1de048c0cb30cb5bfe2ee219083edc1c26..4d6960719a56426ba77a29ccade93808099c8128 100644 (file)
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-plain.h"
 #include "html.h"
index 456f610df41cef1e8b3ebdfd02fd44204a3461d4..11fb9fc0ac2502f63b22319d5fbd05b0e24dfa62 100644 (file)
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-refs.h"
 #include "html.h"
@@ -155,9 +157,11 @@ void cgit_print_branches(int maxcount)
 
        list.refs = NULL;
        list.alloc = list.count = 0;
-       for_each_branch_ref(cgit_refs_cb, &list);
+       refs_for_each_branch_ref(get_main_ref_store(the_repository),
+                                cgit_refs_cb, &list);
        if (ctx.repo->enable_remote_branches)
-               for_each_remote_ref(cgit_refs_cb, &list);
+               refs_for_each_remote_ref(get_main_ref_store(the_repository),
+                                        cgit_refs_cb, &list);
 
        if (maxcount == 0 || maxcount > list.count)
                maxcount = list.count;
@@ -182,7 +186,8 @@ void cgit_print_tags(int maxcount)
 
        list.refs = NULL;
        list.alloc = list.count = 0;
-       for_each_tag_ref(cgit_refs_cb, &list);
+       refs_for_each_tag_ref(get_main_ref_store(the_repository),
+                             cgit_refs_cb, &list);
        if (list.count == 0)
                return;
        qsort(list.refs, list.count, sizeof(*list.refs), cmp_tag_age);
index d5b5b203b7dbdc6a6b7e03096de45163ede76286..6fae72d1beea4c4e1487458b20ba7cd60d06dc27 100644 (file)
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-shared.h"
 #include "cmd.h"
@@ -1041,9 +1043,11 @@ static void print_header(void)
                        html("<form method='get'>\n");
                        cgit_add_hidden_formfields(0, 1, ctx.qry.page);
                        html("<select name='h' onchange='this.form.submit();'>\n");
-                       for_each_branch_ref(print_branch_option, ctx.qry.head);
+                       refs_for_each_branch_ref(get_main_ref_store(the_repository),
+                                                print_branch_option, ctx.qry.head);
                        if (ctx.repo->enable_remote_branches)
-                               for_each_remote_ref(print_branch_option, ctx.qry.head);
+                               refs_for_each_remote_ref(get_main_ref_store(the_repository),
+                                                        print_branch_option, ctx.qry.head);
                        html("</select> ");
                        html("<input type='submit' value='switch'/>");
                        html("</form>");
index 9f629a9a3e61bedf4636e9c153e3e756633fa386..3e38cd5aa751aa66a48778547ce67daa5454cc0a 100644 (file)
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-snapshot.h"
 #include "html.h"
index 1ac67da7075ce1396d542cc2f7a3465d626ecb56..02c60efa2a5c9ff1f5a168acb2459f79e778f51c 100644 (file)
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-stats.h"
 #include "html.h"
index 53548279d99efd8d222a32cc07b216ebae88dd66..3b112264b57d2ac17ba9ca8b539ea5d7597b8c1d 100644 (file)
--- a/ui-tag.c
+++ b/ui-tag.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-tag.h"
 #include "html.h"
index 064033622355e4a30dce22e5d6d27f1fa38b44ec..3d8a2eb53eff20f7e63d7f671f6e787636b66d1b 100644 (file)
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -6,6 +6,8 @@
  *   (see COPYING for full license text)
  */
 
+ #define USE_THE_REPOSITORY_VARIABLE
+
 #include "cgit.h"
 #include "ui-tree.h"
 #include "html.h"