sha1_file: guard against invalid loose subdirectory numbers
[gitweb.git] / builtin / prune-packed.c
index 7cf900ea0765e334f02df5600f0911d41563a027..ac978ad401c01c4f44d3134b95a2bcb8b29973f9 100644 (file)
@@ -10,7 +10,7 @@ static const char * const prune_packed_usage[] = {
 
 static struct progress *progress;
 
-static int prune_subdir(int nr, const char *path, void *data)
+static int prune_subdir(unsigned int nr, const char *path, void *data)
 {
        int *opts = data;
        display_progress(progress, nr + 1);
@@ -19,12 +19,12 @@ static int prune_subdir(int nr, const char *path, void *data)
        return 0;
 }
 
-static int prune_object(const unsigned char *sha1, const char *path,
+static int prune_object(const struct object_id *oid, const char *path,
                         void *data)
 {
        int *opts = data;
 
-       if (!has_sha1_pack(sha1))
+       if (!has_sha1_pack(oid->hash))
                return 0;
 
        if (*opts & PRUNE_PACKED_DRY_RUN)