diff --git a/builtin/index-pack.c b/builtin/index-pack.c index de35960d99bb6c92c0f57c588aa6f43e3c227d2c..54b089542b91fe786f4f75fe363cd1d5fb1635ff 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -207,8 +207,13 @@ static unsigned check_object(struct object *obj) if (!(obj->flags & FLAG_CHECKED)) { unsigned long size; int type = sha1_object_info(obj->sha1, &size); - if (type != obj->type || type <= 0) - die(_("object of unexpected type")); + if (type <= 0) + die(_("did not receive expected object %s"), + sha1_to_hex(obj->sha1)); + if (type != obj->type) + die(_("object %s: expected type %s, found %s"), + sha1_to_hex(obj->sha1), + typename(obj->type), typename(type)); obj->flags |= FLAG_CHECKED; return 1; }