]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/show-ref.c
object-name.h: move declarations for object-name.c functions from cache.h
[thirdparty/git.git] / builtin / show-ref.c
index 3af6a53ee9750ef5d4e45031ae0088d5e12f37a4..a2243b42195b1b89c49a26f0c80b2bc09de142da 100644 (file)
@@ -1,7 +1,10 @@
 #include "builtin.h"
 #include "cache.h"
 #include "config.h"
+#include "gettext.h"
+#include "hex.h"
 #include "refs.h"
+#include "object-name.h"
 #include "object-store.h"
 #include "object.h"
 #include "tag.h"
@@ -26,14 +29,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
@@ -43,7 +46,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);
        }
 }