index_has_changes(): avoid assuming operating on the_index
[gitweb.git] / builtin / unpack-objects.c
index 648b952ab00821b28422d7e225c910a24027754f..c8f1406d2340c5cf2c1ac775039e32a244fede33 100644 (file)
@@ -572,8 +572,11 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
        unpack_all();
        the_hash_algo->update_fn(&ctx, buffer, offset);
        the_hash_algo->final_fn(oid.hash, &ctx);
-       if (strict)
+       if (strict) {
                write_rest();
+               if (fsck_finish(&fsck_options))
+                       die(_("fsck error in pack objects"));
+       }
        if (hashcmp(fill(the_hash_algo->rawsz), oid.hash))
                die("final sha1 did not match");
        use(the_hash_algo->rawsz);