git: update to v2.32.0

Update to git version v2.32.0, this requires changes for these
upstream commits:

* 47957485b3b731a7860e0554d2bd12c0dce1c75a
  tree.h API: simplify read_tree_recursive() signature

Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Christian Hesse 2021-05-18 22:49:13 +02:00
parent 6dbbffe015
commit 5258c297ba
6 changed files with 24 additions and 37 deletions

View File

@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
GIT_VER = 2.31.1
GIT_VER = 2.32.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r

2
git

@ -1 +1 @@
Subproject commit 48bf2fa8bad054d66bd79c6ba903c89c704201f7
Subproject commit ebf3c04b262aa27fbb97f8a0156c2347fecafafb

View File

@ -221,8 +221,7 @@ cleanup:
}
static int walk_tree(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, int stage,
void *cbdata)
const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
@ -291,9 +290,7 @@ void cgit_print_blame(void)
walk_tree_ctx.match_baselen = (path_items.match) ?
basedir_len(path_items.match) : -1;
read_tree_recursive(the_repository,
repo_get_commit_tree(the_repository, commit),
"", 0, 0,
read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
&paths, walk_tree, &walk_tree_ctx);
if (!walk_tree_ctx.state)
cgit_print_error_page(404, "Not found", "Not found");

View File

@ -19,7 +19,7 @@ struct walk_tree_context {
};
static int walk_tree(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, int stage, void *cbdata)
const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
@ -56,9 +56,9 @@ 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(the_repository,
read_tree(the_repository,
repo_get_commit_tree(the_repository, lookup_commit_reference(the_repository, &oid)),
"", 0, 0, &paths, walk_tree, &walk_tree_ctx);
&paths, walk_tree, &walk_tree_ctx);
done:
free(path_items.match);
@ -92,10 +92,8 @@ int cgit_print_file(char *path, const char *head, int file_only)
type = oid_object_info(the_repository, &oid, &size);
if (type == OBJ_COMMIT) {
commit = lookup_commit_reference(the_repository, &oid);
read_tree_recursive(the_repository,
repo_get_commit_tree(the_repository, commit),
"", 0, 0, &paths, walk_tree,
&walk_tree_ctx);
read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
&paths, walk_tree, &walk_tree_ctx);
if (!walk_tree_ctx.found_path)
return -1;
type = oid_object_info(the_repository, &oid, &size);
@ -151,10 +149,8 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl
if ((!hex) && type == OBJ_COMMIT && path) {
commit = lookup_commit_reference(the_repository, &oid);
read_tree_recursive(the_repository,
repo_get_commit_tree(the_repository, commit),
"", 0, 0, &paths, walk_tree,
&walk_tree_ctx);
read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
&paths, walk_tree, &walk_tree_ctx);
type = oid_object_info(the_repository, &oid, &size);
}

View File

@ -130,7 +130,7 @@ static void print_dir_tail(void)
}
static int walk_tree(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, int stage, void *cbdata)
const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
@ -198,9 +198,8 @@ void cgit_print_plain(void)
}
else
walk_tree_ctx.match_baselen = basedir_len(path_items.match);
read_tree_recursive(the_repository,
repo_get_commit_tree(the_repository, commit),
"", 0, 0, &paths, walk_tree, &walk_tree_ctx);
read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
&paths, walk_tree, &walk_tree_ctx);
if (!walk_tree_ctx.match)
cgit_print_error_page(404, "Not found", "Not found");
else if (walk_tree_ctx.match == 2)

View File

@ -139,8 +139,7 @@ struct single_tree_ctx {
};
static int single_tree_cb(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, int stage,
void *cbdata)
const char *pathname, unsigned mode, void *cbdata)
{
struct single_tree_ctx *ctx = cbdata;
@ -185,8 +184,7 @@ static void write_tree_link(const struct object_id *oid, char *name,
tree_ctx.name = NULL;
tree_ctx.count = 0;
read_tree_recursive(the_repository, tree, "", 0, 1,
&paths, single_tree_cb, &tree_ctx);
read_tree(the_repository, tree, &paths, single_tree_cb, &tree_ctx);
if (tree_ctx.count != 1)
break;
@ -199,7 +197,7 @@ static void write_tree_link(const struct object_id *oid, char *name,
}
static int ls_item(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, int stage, void *cbdata)
const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
char *name;
@ -294,14 +292,13 @@ static void ls_tree(const struct object_id *oid, const char *path, struct walk_t
}
ls_head();
read_tree_recursive(the_repository, tree, "", 0, 1,
&paths, ls_item, walk_tree_ctx);
read_tree(the_repository, tree, &paths, ls_item, walk_tree_ctx);
ls_tail();
}
static int walk_tree(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, int stage, void *cbdata)
const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
@ -326,7 +323,7 @@ static int walk_tree(const struct object_id *oid, struct strbuf *base,
return 0;
}
}
ls_item(oid, base, pathname, mode, stage, walk_tree_ctx);
ls_item(oid, base, pathname, mode, walk_tree_ctx);
return 0;
}
@ -374,9 +371,7 @@ void cgit_print_tree(const char *rev, char *path)
goto cleanup;
}
read_tree_recursive(the_repository,
repo_get_commit_tree(the_repository, commit),
"", 0, 0,
read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
&paths, walk_tree, &walk_tree_ctx);
if (walk_tree_ctx.state == 1)
ls_tail();