#include "fsck.h"
static int dry_run, quiet, recover, has_errors, strict;
-static const char unpack_usage[] = "git unpack-objects [-n] [-q] [-r] [--strict] < pack-file";
+static const char unpack_usage[] = "git unpack-objects [-n] [-q] [-r] [--strict]";
/* We always read in 4kB chunks. */
static unsigned char buffer[4096];
obj->buffer = buffer;
obj->size = size;
if (add_decoration(&obj_decorate, object, obj))
- die("object %s tried to add buffer twice!", sha1_to_hex(object->sha1));
+ die("object %s tried to add buffer twice!", oid_to_hex(&object->oid));
}
/*
unsigned char sha1[20];
if (write_sha1_file(obj_buf->buffer, obj_buf->size, typename(obj->type), sha1) < 0)
- die("failed to write object %s", sha1_to_hex(obj->sha1));
+ die("failed to write object %s", oid_to_hex(&obj->oid));
obj->flags |= FLAG_WRITTEN;
}
if (!(obj->flags & FLAG_OPEN)) {
unsigned long size;
- int type = sha1_object_info(obj->sha1, &size);
+ int type = sha1_object_info(get_object_hash(*obj), &size);
if (type != obj->type || type <= 0)
die("object of unexpected type");
obj->flags |= FLAG_WRITTEN;
obj_buf = lookup_object_buffer(obj);
if (!obj_buf)
- die("Whoops! Cannot find object '%s'", sha1_to_hex(obj->sha1));
+ die("Whoops! Cannot find object '%s'", oid_to_hex(&obj->oid));
if (fsck_object(obj, obj_buf->buffer, obj_buf->size, &fsck_options))
die("Error in object");
fsck_options.walk = check_object;
if (fsck_walk(obj, NULL, &fsck_options))
- die("Error on reachable objects of %s", sha1_to_hex(obj->sha1));
+ die("Error on reachable objects of %s", oid_to_hex(&obj->oid));
write_cached_object(obj, obj_buf);
return 0;
}