Merge branch 'ab/remove-implicit-use-of-the-repository' into en/header-split-cache-h

* ab/remove-implicit-use-of-the-repository:
  libs: use "struct repository *" argument, not "the_repository"
  post-cocci: adjust comments for recent repo_* migration
  cocci: apply the "revision.h" part of "the_repository.pending"
  cocci: apply the "rerere.h" part of "the_repository.pending"
  cocci: apply the "refs.h" part of "the_repository.pending"
  cocci: apply the "promisor-remote.h" part of "the_repository.pending"
  cocci: apply the "packfile.h" part of "the_repository.pending"
  cocci: apply the "pretty.h" part of "the_repository.pending"
  cocci: apply the "object-store.h" part of "the_repository.pending"
  cocci: apply the "diff.h" part of "the_repository.pending"
  cocci: apply the "commit.h" part of "the_repository.pending"
  cocci: apply the "commit-reach.h" part of "the_repository.pending"
  cocci: apply the "cache.h" part of "the_repository.pending"
  cocci: add missing "the_repository" macros to "pending"
  cocci: sort "the_repository" rules by header
  cocci: fix incorrect & verbose "the_repository" rules
  cocci: remove dead rule from "the_repository.pending.cocci"
This commit is contained in:
Junio C Hamano
2023-04-04 08:25:52 -07:00
148 changed files with 958 additions and 873 deletions

View File

@ -96,7 +96,7 @@ static int read_patches(const char *range, struct string_list *list,
strbuf_reset(&buf);
}
CALLOC_ARRAY(util, 1);
if (get_oid(p, &util->oid)) {
if (repo_get_oid(the_repository, p, &util->oid)) {
error(_("could not parse commit '%s'"), p);
FREE_AND_NULL(util);
string_list_clear(list, 1);
@ -392,7 +392,7 @@ static void output_pair_header(struct diff_options *diffopt,
if (!dashes->len)
strbuf_addchars(dashes, '-',
strlen(find_unique_abbrev(oid, abbrev)));
strlen(repo_find_unique_abbrev(the_repository, oid, abbrev)));
if (!b_util) {
color = color_old;
@ -414,7 +414,7 @@ static void output_pair_header(struct diff_options *diffopt,
strbuf_addf(buf, "%*s: %s ", patch_no_width, "-", dashes->buf);
else
strbuf_addf(buf, "%*d: %s ", patch_no_width, a_util->i + 1,
find_unique_abbrev(&a_util->oid, abbrev));
repo_find_unique_abbrev(the_repository, &a_util->oid, abbrev));
if (status == '!')
strbuf_addf(buf, "%s%s", color_reset, color);
@ -426,7 +426,7 @@ static void output_pair_header(struct diff_options *diffopt,
strbuf_addf(buf, " %*s: %s", patch_no_width, "-", dashes->buf);
else
strbuf_addf(buf, " %*d: %s", patch_no_width, b_util->i + 1,
find_unique_abbrev(&b_util->oid, abbrev));
repo_find_unique_abbrev(the_repository, &b_util->oid, abbrev));
commit = lookup_commit_reference(the_repository, oid);
if (commit) {
@ -487,7 +487,7 @@ static void output(struct string_list *a, struct string_list *b,
if (range_diff_opts->diffopt)
memcpy(&opts, range_diff_opts->diffopt, sizeof(opts));
else
diff_setup(&opts);
repo_diff_setup(the_repository, &opts);
opts.no_free = 1;
if (!opts.output_format)
@ -590,7 +590,7 @@ int is_range_diff_range(const char *arg)
int i, positive = 0, negative = 0;
struct rev_info revs;
init_revisions(&revs, NULL);
repo_init_revisions(the_repository, &revs, NULL);
if (setup_revisions(3, argv, &revs, NULL) == 1) {
for (i = 0; i < revs.pending.nr; i++)
if (revs.pending.objects[i].item->flags & UNINTERESTING)