rebase -i: demonstrate a bug with --autosquash
[gitweb.git] / builtin / fsck.c
index 7bfb4938fb62da39a790425e34f88dfce6749c2b..3f27456883ede5efa2a57cfa9e2dcc889e952338 100644 (file)
@@ -186,7 +186,7 @@ static void check_reachable_object(struct object *obj)
         * do a full fsck
         */
        if (!(obj->flags & HAS_OBJ)) {
-               if (has_sha1_pack(get_object_hash(*obj)))
+               if (has_sha1_pack(obj->oid.hash))
                        return; /* it is in pack - forget about it */
                if (connectivity_only && has_object_file(&obj->oid))
                        return;
@@ -249,7 +249,7 @@ static void check_unreachable_object(struct object *obj)
                        if (!(f = fopen(filename, "w")))
                                die_errno("Could not open '%s'", filename);
                        if (obj->type == OBJ_BLOB) {
-                               if (stream_blob_to_fd(fileno(f), get_object_hash(*obj), NULL, 1))
+                               if (stream_blob_to_fd(fileno(f), obj->oid.hash, NULL, 1))
                                        die_errno("Could not write '%s'", filename);
                        } else
                                fprintf(f, "%s\n", oid_to_hex(&obj->oid));
@@ -493,13 +493,12 @@ static void fsck_object_dir(const char *path)
 
 static int fsck_head_link(void)
 {
-       int flag;
        int null_is_error = 0;
 
        if (verbose)
                fprintf(stderr, "Checking HEAD link\n");
 
-       head_points_at = resolve_ref_unsafe("HEAD", 0, head_oid.hash, &flag);
+       head_points_at = resolve_ref_unsafe("HEAD", 0, head_oid.hash, NULL);
        if (!head_points_at) {
                errors_found |= ERROR_REFS;
                return error("Invalid HEAD");