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

@ -25,7 +25,8 @@
static const char *short_commit_name(struct commit *commit)
{
return find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV);
return repo_find_unique_abbrev(the_repository, &commit->object.oid,
DEFAULT_ABBREV);
}
static struct commit *peel_committish(const char *name)
@ -33,10 +34,11 @@ static struct commit *peel_committish(const char *name)
struct object *obj;
struct object_id oid;
if (get_oid(name, &oid))
if (repo_get_oid(the_repository, name, &oid))
return NULL;
obj = parse_object(the_repository, &oid);
return (struct commit *)peel_to_type(name, 0, obj, OBJ_COMMIT);
return (struct commit *)repo_peel_to_type(the_repository, name, 0, obj,
OBJ_COMMIT);
}
static char *get_author(const char *message)
@ -119,7 +121,7 @@ int cmd__fast_rebase(int argc, const char **argv)
strbuf_addf(&branch_name, "refs/heads/%s", argv[4]);
/* Sanity check */
if (get_oid("HEAD", &head))
if (repo_get_oid(the_repository, "HEAD", &head))
die(_("Cannot read HEAD"));
assert(oideq(&onto->object.oid, &head));