deref_tag: handle return value NULL
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
9886ea417b
commit
affeef12fb
@ -56,7 +56,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
|
||||
if (i < heads->nr) {
|
||||
commit = (struct commit *)
|
||||
deref_tag(heads->objects[i++].item, NULL, 0);
|
||||
if (commit->object.type != OBJ_COMMIT) {
|
||||
if (!commit || commit->object.type != OBJ_COMMIT) {
|
||||
commit = NULL;
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user