cocci: apply the "commit.h" part of "the_repository.pending"

Apply the part of "the_repository.pending.cocci" pertaining to
"commit.h".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason
2023-03-28 15:58:48 +02:00
committed by Junio C Hamano
parent cb338c23d6
commit ecb5091fd4
44 changed files with 196 additions and 174 deletions

View File

@ -1329,7 +1329,8 @@ static void get_commit_info(struct am_state *state, struct commit *commit)
size_t ident_len;
struct ident_split id;
buffer = logmsg_reencode(commit, NULL, get_commit_output_encoding());
buffer = repo_logmsg_reencode(the_repository, commit, NULL,
get_commit_output_encoding());
ident_line = find_commit_header(buffer, "author", &ident_len);
if (!ident_line)
@ -1361,7 +1362,7 @@ static void get_commit_info(struct am_state *state, struct commit *commit)
die(_("unable to parse commit %s"), oid_to_hex(&commit->object.oid));
state->msg = xstrdup(msg + 2);
state->msg_len = strlen(state->msg);
unuse_commit_buffer(commit, buffer);
repo_unuse_commit_buffer(the_repository, commit, buffer);
}
/**
@ -1404,7 +1405,7 @@ static void write_index_patch(const struct am_state *state)
if (!repo_get_oid(the_repository, "HEAD", &head)) {
struct commit *commit = lookup_commit_or_die(&head, "HEAD");
tree = get_commit_tree(commit);
tree = repo_get_commit_tree(the_repository, commit);
} else
tree = lookup_tree(the_repository,
the_repository->hash_algo->empty_tree);