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

@ -15,7 +15,8 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
{
struct commit_list *result, *r;
result = get_merge_bases_many_dirty(rev[0], rev_nr - 1, rev + 1);
result = repo_get_merge_bases_many_dirty(the_repository, rev[0],
rev_nr - 1, rev + 1);
if (!result)
return 1;
@ -44,7 +45,7 @@ static struct commit *get_commit_reference(const char *arg)
struct object_id revkey;
struct commit *r;
if (get_oid(arg, &revkey))
if (repo_get_oid(the_repository, arg, &revkey))
die("Not a valid object name %s", arg);
r = lookup_commit_reference(the_repository, &revkey);
if (!r)
@ -107,7 +108,7 @@ static int handle_is_ancestor(int argc, const char **argv)
die("--is-ancestor takes exactly two commits");
one = get_commit_reference(argv[0]);
two = get_commit_reference(argv[1]);
if (in_merge_bases(one, two))
if (repo_in_merge_bases(the_repository, one, two))
return 0;
else
return 1;
@ -120,7 +121,7 @@ static int handle_fork_point(int argc, const char **argv)
const char *commitname;
commitname = (argc == 2) ? argv[1] : "HEAD";
if (get_oid(commitname, &oid))
if (repo_get_oid(the_repository, commitname, &oid))
die("Not a valid object name: '%s'", commitname);
derived = lookup_commit_reference(the_repository, &oid);