index-pack: make fsck error message more specific
authorJeff King <peff@peff.net>
Wed, 2 May 2018 20:37:09 +0000 (16:37 -0400)
committerJeff King <peff@peff.net>
Tue, 22 May 2018 03:55:12 +0000 (23:55 -0400)
If fsck reports an error, we say only "Error in object".
This isn't quite as bad as it might seem, since the fsck
code would have dumped some errors to stderr already. But it
might help to give a little more context. The earlier output
would not have even mentioned "fsck", and that may be a clue
that the "fsck.*" or "*.fsckObjects" config may be relevant.

Signed-off-by: Jeff King <peff@peff.net>
builtin/index-pack.c
builtin/unpack-objects.c
index bda84a92effe41adb1e50a06ff6accac0563d04a..d15b24eebb0e025e538b5db825077fe6f7b50317 100644 (file)
@@ -853,7 +853,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
                                die(_("invalid %s"), type_name(type));
                        if (do_fsck_object &&
                            fsck_object(obj, buf, size, &fsck_options))
-                               die(_("Error in object"));
+                               die(_("fsck error in packed object"));
                        if (strict && fsck_walk(obj, NULL, &fsck_options))
                                die(_("Not all child objects of %s are reachable"), oid_to_hex(&obj->oid));
 
index 6620feec68b15573340f4c28fe6be952e3c00e3a..648b952ab00821b28422d7e225c910a24027754f 100644 (file)
@@ -210,7 +210,7 @@ static int check_object(struct object *obj, int type, void *data, struct fsck_op
        if (!obj_buf)
                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");
+               die("fsck error in packed object");
        fsck_options.walk = check_object;
        if (fsck_walk(obj, NULL, &fsck_options))
                die("Error on reachable objects of %s", oid_to_hex(&obj->oid));