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

Apply the part of "the_repository.pending.cocci" pertaining to
"cache.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:46 +02:00
committed by Junio C Hamano
parent 7258e892d2
commit d850b7a545
79 changed files with 332 additions and 310 deletions

View File

@ -233,7 +233,8 @@ static void show_parents(struct commit *commit, int abbrev, FILE *file)
struct commit_list *p;
for (p = commit->parents; p ; p = p->next) {
struct commit *parent = p->item;
fprintf(file, " %s", find_unique_abbrev(&parent->object.oid, abbrev));
fprintf(file, " %s",
repo_find_unique_abbrev(the_repository, &parent->object.oid, abbrev));
}
}
@ -241,7 +242,8 @@ static void show_children(struct rev_info *opt, struct commit *commit, int abbre
{
struct commit_list *p = lookup_decoration(&opt->children, &commit->object);
for ( ; p; p = p->next) {
fprintf(opt->diffopt.file, " %s", find_unique_abbrev(&p->item->object.oid, abbrev));
fprintf(opt->diffopt.file, " %s",
repo_find_unique_abbrev(the_repository, &p->item->object.oid, abbrev));
}
}
@ -644,7 +646,8 @@ void show_log(struct rev_info *opt)
if (!opt->graph)
put_revision_mark(opt, commit);
fputs(find_unique_abbrev(&commit->object.oid, abbrev_commit), opt->diffopt.file);
fputs(repo_find_unique_abbrev(the_repository, &commit->object.oid, abbrev_commit),
opt->diffopt.file);
if (opt->print_parents)
show_parents(commit, abbrev_commit, opt->diffopt.file);
if (opt->children.name)
@ -706,8 +709,8 @@ void show_log(struct rev_info *opt)
if (!opt->graph)
put_revision_mark(opt, commit);
fputs(find_unique_abbrev(&commit->object.oid,
abbrev_commit),
fputs(repo_find_unique_abbrev(the_repository, &commit->object.oid,
abbrev_commit),
opt->diffopt.file);
if (opt->print_parents)
show_parents(commit, abbrev_commit, opt->diffopt.file);
@ -715,7 +718,7 @@ void show_log(struct rev_info *opt)
show_children(opt, commit, abbrev_commit);
if (parent)
fprintf(opt->diffopt.file, " (from %s)",
find_unique_abbrev(&parent->object.oid, abbrev_commit));
repo_find_unique_abbrev(the_repository, &parent->object.oid, abbrev_commit));
fputs(diff_get_color_opt(&opt->diffopt, DIFF_RESET), opt->diffopt.file);
show_decorations(opt, commit);
if (opt->commit_format == CMIT_FMT_ONELINE) {