Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-06 22:28:13 +0400
committerJunio C Hamano <gitster@pobox.com>2014-06-06 22:28:13 +0400
commita0460132a740d8ff0c08dcbd54520f1b795298b9 (patch)
treefd6c2f9cca2cb3b880cd45f359a35ddb60dfb551 /builtin/index-pack.c
parente934c67b6683c1bd504646647b7ee04ee0d9e15b (diff)
parent77583e7739c76f623f49681c9ee4d10a313fe786 (diff)
Merge branch 'jk/index-pack-report-missing'
* jk/index-pack-report-missing: index-pack: distinguish missing objects from type errors
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 87d8dd81cc..18f57de58b 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;
}