Skip to content

Commit

Permalink
Merge branch 'jk/index-pack-report-missing' into maint
Browse files Browse the repository at this point in the history
The error reporting from "git index-pack" has been improved to
distinguish missing objects from type errors.

* jk/index-pack-report-missing:
  index-pack: distinguish missing objects from type errors
  • Loading branch information
Junio C Hamano committed Jun 25, 2014
2 parents a9041df + 77583e7 commit 182c3d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions builtin/index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 182c3d6

Please sign in to comment.