diff --git a/sha1_name.c b/sha1_name.c
index be8489e4e5fc98c6e38036a40fb5ca8c0db77ebc..c2805e736b3086a0e33271a4b5c73cea7d2c55cd 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
return error("%.*s: expected %s type, but the object dereferences to %s type",
len, name, typename(expected_type),
typename(o->type));
return error("%.*s: expected %s type, but the object dereferences to %s type",
len, name, typename(expected_type),
typename(o->type));
+ if (!o)
+ return -1;
if (!o->parsed)
if (!o->parsed)
- parse_object(o->sha1);
+ if (!parse_object(o->sha1))
+ return -1;
}
}
return 0;
}
}
return 0;
struct object *object = parse_object(sha1);
if (!object)
return 0;
struct object *object = parse_object(sha1);
if (!object)
return 0;
- if (object->type == OBJ_TAG)
+ if (object->type == OBJ_TAG) {
object = deref_tag(object, path, strlen(path));
object = deref_tag(object, path, strlen(path));
+ if (!object)
+ return 0;
+ }
if (object->type != OBJ_COMMIT)
return 0;
insert_by_date((struct commit *)object, list);
if (object->type != OBJ_COMMIT)
return 0;
insert_by_date((struct commit *)object, list);
unsigned long size;
commit = pop_most_recent_commit(&list, ONELINE_SEEN);
unsigned long size;
commit = pop_most_recent_commit(&list, ONELINE_SEEN);
- parse_object(commit->object.sha1);
+ if (!parse_object(commit->object.sha1))
+ continue;
if (temp_commit_buffer)
free(temp_commit_buffer);
if (commit->buffer)
if (temp_commit_buffer)
free(temp_commit_buffer);
if (commit->buffer)