diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-03-28 15:58:46 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-28 07:36:36 -0700 |
commit | d850b7a545fcfbd97460a921c7f7c59d933eb0f7 (patch) | |
tree | e36940d63b92557a8d930301ff96e70e55cc222d /t/helper | |
parent | 7258e892d2c0f7a615562656e9978f39f610c056 (diff) | |
download | git-d850b7a545fcfbd97460a921c7f7c59d933eb0f7.tar.gz |
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>
Diffstat (limited to 't/helper')
-rw-r--r-- | t/helper/test-fast-rebase.c | 10 | ||||
-rw-r--r-- | t/helper/test-match-trees.c | 4 | ||||
-rw-r--r-- | t/helper/test-oidmap.c | 6 | ||||
-rw-r--r-- | t/helper/test-reach.c | 2 | ||||
-rw-r--r-- | t/helper/test-submodule-config.c | 2 |
5 files changed, 13 insertions, 11 deletions
diff --git a/t/helper/test-fast-rebase.c b/t/helper/test-fast-rebase.c index efc82dd80c..5d1284328d 100644 --- a/t/helper/test-fast-rebase.c +++ b/t/helper/test-fast-rebase.c @@ -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)); diff --git a/t/helper/test-match-trees.c b/t/helper/test-match-trees.c index 4079fdee06..daadf3827a 100644 --- a/t/helper/test-match-trees.c +++ b/t/helper/test-match-trees.c @@ -9,9 +9,9 @@ int cmd__match_trees(int ac, const char **av) setup_git_directory(); - if (get_oid(av[1], &hash1)) + if (repo_get_oid(the_repository, av[1], &hash1)) die("cannot parse %s as an object name", av[1]); - if (get_oid(av[2], &hash2)) + if (repo_get_oid(the_repository, av[2], &hash2)) die("cannot parse %s as an object name", av[2]); one = parse_tree_indirect(&hash1); if (!one) diff --git a/t/helper/test-oidmap.c b/t/helper/test-oidmap.c index 0acf99931e..7b194edde2 100644 --- a/t/helper/test-oidmap.c +++ b/t/helper/test-oidmap.c @@ -49,7 +49,7 @@ int cmd__oidmap(int argc, const char **argv) if (!strcmp("put", cmd) && p1 && p2) { - if (get_oid(p1, &oid)) { + if (repo_get_oid(the_repository, p1, &oid)) { printf("Unknown oid: %s\n", p1); continue; } @@ -67,7 +67,7 @@ int cmd__oidmap(int argc, const char **argv) } else if (!strcmp("get", cmd) && p1) { - if (get_oid(p1, &oid)) { + if (repo_get_oid(the_repository, p1, &oid)) { printf("Unknown oid: %s\n", p1); continue; } @@ -80,7 +80,7 @@ int cmd__oidmap(int argc, const char **argv) } else if (!strcmp("remove", cmd) && p1) { - if (get_oid(p1, &oid)) { + if (repo_get_oid(the_repository, p1, &oid)) { printf("Unknown oid: %s\n", p1); continue; } diff --git a/t/helper/test-reach.c b/t/helper/test-reach.c index 2f65c7f6a5..00f0f29a6a 100644 --- a/t/helper/test-reach.c +++ b/t/helper/test-reach.c @@ -57,7 +57,7 @@ int cmd__reach(int ac, const char **av) if (buf.len < 3) continue; - if (get_oid_committish(buf.buf + 2, &oid)) + if (repo_get_oid_committish(the_repository, buf.buf + 2, &oid)) die("failed to resolve %s", buf.buf + 2); orig = parse_object(r, &oid); diff --git a/t/helper/test-submodule-config.c b/t/helper/test-submodule-config.c index 22a41c4092..91c82d4159 100644 --- a/t/helper/test-submodule-config.c +++ b/t/helper/test-submodule-config.c @@ -42,7 +42,7 @@ int cmd__submodule_config(int argc, const char **argv) if (commit[0] == '\0') oidclr(&commit_oid); - else if (get_oid(commit, &commit_oid) < 0) + else if (repo_get_oid(the_repository, commit, &commit_oid) < 0) die_usage(argc, argv, "Commit not found."); if (lookup_name) { |