index 381cc8d4fd69ca31fb8fc8af31422160e3ec1fd3..69cdae54b207b7cecd2f95bec785797dd17233fc 100644 (file)
--- a/diff.c
+++ b/diff.c
}
else {
enum object_type type;
- if (size_only)
+ if (size_only) {
type = sha1_object_info(s->sha1, &s->size);
- else {
+ if (type < 0)
+ die("unable to read %s", sha1_to_hex(s->sha1));
+ } else {
s->data = read_sha1_file(s->sha1, &type, &s->size);
+ if (!s->data)
+ die("unable to read %s", sha1_to_hex(s->sha1));
s->should_free = 1;
}
}