]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/prune.c
Merge branch 'rs/sha1-name-readdir-optim'
[thirdparty/git.git] / builtin / prune.c
index ea208c97f883d0bc0c7c9d78e710db457555393b..c378690545b27b7e4753e0f919f3ea6626b0eae9 100644 (file)
@@ -13,7 +13,7 @@ static const char * const prune_usage[] = {
 };
 static int show_only;
 static int verbose;
-static unsigned long expire;
+static timestamp_t expire;
 static int show_progress = -1;
 
 static int prune_tmp_file(const char *fullpath)
@@ -111,7 +111,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
        };
        char *s;
 
-       expire = ULONG_MAX;
+       expire = TIME_MAX;
        save_commit_buffer = 0;
        check_replace_refs = 0;
        ref_paranoia = 1;
@@ -123,11 +123,12 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
                die(_("cannot prune in a precious-objects repo"));
 
        while (argc--) {
-               unsigned char sha1[20];
+               struct object_id oid;
                const char *name = *argv++;
 
-               if (!get_sha1(name, sha1)) {
-                       struct object *object = parse_object_or_die(sha1, name);
+               if (!get_oid(name, &oid)) {
+                       struct object *object = parse_object_or_die(&oid,
+                                                                   name);
                        add_pending_object(&revs, object, "");
                }
                else