transport.c: introduce core.alternateRefsPrefixes
[gitweb.git] / builtin / prune.c
index 4394d01c9350ae3e1fa26de034edf1509128469e..4916a4daa264ee695dbfbde81dbd8ef0072ac9c4 100644 (file)
@@ -6,6 +6,7 @@
 #include "reachable.h"
 #include "parse-options.h"
 #include "progress.h"
+#include "object-store.h"
 
 static const char * const prune_usage[] = {
        N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),
@@ -39,7 +40,7 @@ static int prune_object(const struct object_id *oid, const char *fullpath,
         * Do we know about this object?
         * It must have been reachable
         */
-       if (lookup_object(oid->hash))
+       if (lookup_object(the_repository, oid->hash))
                return 0;
 
        if (lstat(fullpath, &st)) {
@@ -50,7 +51,8 @@ static int prune_object(const struct object_id *oid, const char *fullpath,
        if (st.st_mtime > expire)
                return 0;
        if (show_only || verbose) {
-               enum object_type type = sha1_object_info(oid->hash, NULL);
+               enum object_type type = oid_object_info(the_repository, oid,
+                                                       NULL);
                printf("%s %s\n", oid_to_hex(oid),
                       (type > 0) ? type_name(type) : "unknown");
        }
@@ -116,7 +118,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
 
        expire = TIME_MAX;
        save_commit_buffer = 0;
-       check_replace_refs = 0;
+       read_replace_refs = 0;
        ref_paranoia = 1;
        init_revisions(&revs, prefix);
 
@@ -158,7 +160,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
        remove_temporary_files(s);
        free(s);
 
-       if (is_repository_shallow())
+       if (is_repository_shallow(the_repository))
                prune_shallow(show_only);
 
        return 0;