summaryrefslogtreecommitdiff
path: root/builtin/show-ref.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-04-04 08:25:52 -0700
committerJunio C Hamano <gitster@pobox.com>2023-04-04 08:25:52 -0700
commite7dca80692dec7f0717d9ad6d978d0ceab90cf6a (patch)
tree3fd355c15df79b7e89ba63c906b6b5b34100513e /builtin/show-ref.c
parentec2f02696157d3781fbfd410f0017c49cc1eda01 (diff)
parent4a93b899c19794c28b140bf78a13fb9c2b34f433 (diff)
downloadgit-e7dca80692dec7f0717d9ad6d978d0ceab90cf6a.tar.gz
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"
Diffstat (limited to 'builtin/show-ref.c')
-rw-r--r--builtin/show-ref.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index a5df7587d5..138d30a005 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -28,14 +28,14 @@ static void show_one(const char *refname, const struct object_id *oid)
const char *hex;
struct object_id peeled;
- if (!has_object_file(oid))
+ if (!repo_has_object_file(the_repository, oid))
die("git show-ref: bad ref %s (%s)", refname,
oid_to_hex(oid));
if (quiet)
return;
- hex = find_unique_abbrev(oid, abbrev);
+ hex = repo_find_unique_abbrev(the_repository, oid, abbrev);
if (hash_only)
printf("%s\n", hex);
else
@@ -45,7 +45,7 @@ static void show_one(const char *refname, const struct object_id *oid)
return;
if (!peel_iterated_oid(oid, &peeled)) {
- hex = find_unique_abbrev(&peeled, abbrev);
+ hex = repo_find_unique_abbrev(the_repository, &peeled, abbrev);
printf("%s %s^{}\n", hex, refname);
}
}