Convert struct object to object_id
[gitweb.git] / builtin / index-pack.c
index b01a8c0e227c7fec7c5456aa9e29972682ac6819..48b470dd7add76223b36860a47c7cab57eabfeb0 100644 (file)
@@ -199,7 +199,7 @@ static int mark_link(struct object *obj, int type, void *data, struct fsck_optio
                return -1;
 
        if (type != OBJ_ANY && obj->type != type)
-               die(_("object type mismatch at %s"), sha1_to_hex(obj->sha1));
+               die(_("object type mismatch at %s"), oid_to_hex(&obj->oid));
 
        obj->flags |= FLAG_LINK;
        return 0;
@@ -220,10 +220,10 @@ static unsigned check_object(struct object *obj)
                int type = sha1_object_info(get_object_hash(*obj), &size);
                if (type <= 0)
                        die(_("did not receive expected object %s"),
-                             sha1_to_hex(obj->sha1));
+                             oid_to_hex(&obj->oid));
                if (type != obj->type)
                        die(_("object %s: expected type %s, found %s"),
-                           sha1_to_hex(obj->sha1),
+                           oid_to_hex(&obj->oid),
                            typename(obj->type), typename(type));
                obj->flags |= FLAG_CHECKED;
                return 1;
@@ -842,7 +842,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
                            fsck_object(obj, buf, size, &fsck_options))
                                die(_("Error in object"));
                        if (fsck_walk(obj, NULL, &fsck_options))
-                               die(_("Not all child objects of %s are reachable"), sha1_to_hex(obj->sha1));
+                               die(_("Not all child objects of %s are reachable"), oid_to_hex(&obj->oid));
 
                        if (obj->type == OBJ_TREE) {
                                struct tree *item = (struct tree *) obj;