Merge branch 'sb/string-list-remove-unused' into maint
[gitweb.git] / builtin / prune.c
index 518ffbea1397faa35102dc088a3830e40c9b13a6..d356ad70f6c3ad06112420e5a5f984fa38f09473 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)) {
@@ -117,8 +118,9 @@ 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;
+       revs.allow_exclude_promisor_objects_opt = 1;
        init_revisions(&revs, prefix);
 
        argc = parse_options(argc, argv, prefix, options, prune_usage, 0);
@@ -159,8 +161,8 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
        remove_temporary_files(s);
        free(s);
 
-       if (is_repository_shallow())
-               prune_shallow(show_only);
+       if (is_repository_shallow(the_repository))
+               prune_shallow(show_only ? PRUNE_SHOW_ONLY : 0);
 
        return 0;
 }