index-pack: make fsck error message more specific

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>

Jeff King committed May 2, 2018 at 16:37 UTC db5a58c1bda5b20169b9958af1e8b05ddd178b01
2 files changed +2 -2
builtin/index-pack.c
+1 -1
@@ -853,7 +853,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
853 die(_("invalid %s"), type_name(type));
854 if (do_fsck_object &&
855 fsck_object(obj, buf, size, &fsck_options))
856 - die(_("Error in object"));
856 + die(_("fsck error in packed object"));
857 if (strict && fsck_walk(obj, NULL, &fsck_options))
858 die(_("Not all child objects of %s are reachable"), oid_to_hex(&obj->oid));
859
builtin/unpack-objects.c
+1 -1
@@ -210,7 +210,7 @@ static int check_object(struct object *obj, int type, void *data, struct fsck_op
210 if (!obj_buf)
211 die("Whoops! Cannot find object '%s'", oid_to_hex(&obj->oid));
212 if (fsck_object(obj, obj_buf->buffer, obj_buf->size, &fsck_options))
213 - die("Error in object");
213 + die("fsck error in packed object");
214 fsck_options.walk = check_object;
215 if (fsck_walk(obj, NULL, &fsck_options))
216 die("Error on reachable objects of %s", oid_to_hex(&obj->oid));