diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-06-25 11:48:13 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-25 11:48:14 -0700 |
commit | 182c3d69e4435aa82c7929f094d45408faf4ec4b (patch) | |
tree | 6b774bbffcf8732eec683fc5c05e8dd4d0e23671 /builtin | |
parent | a9041df7ab712be1bfad9e6b67bf4cbf0f7c9c9b (diff) | |
parent | 77583e7739c76f623f49681c9ee4d10a313fe786 (diff) | |
download | git-182c3d69e4435aa82c7929f094d45408faf4ec4b.tar.gz |
Merge branch 'jk/index-pack-report-missing' into maint
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
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/index-pack.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c index de35960d99..54b089542b 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; } |