parse_commit: don't fail, if object is NULL
Some codepaths (eg. builtin-rev-parse -> get_merge_bases -> parse_commit) can pass 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:
parent
9684afd967
commit
9786f68bfc
2
commit.c
2
commit.c
@ -311,6 +311,8 @@ int parse_commit(struct commit *item)
|
|||||||
unsigned long size;
|
unsigned long size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!item)
|
||||||
|
return -1;
|
||||||
if (item->object.parsed)
|
if (item->object.parsed)
|
||||||
return 0;
|
return 0;
|
||||||
buffer = read_sha1_file(item->object.sha1, &type, &size);
|
buffer = read_sha1_file(item->object.sha1, &type, &size);
|
||||||
|
Loading…
Reference in New Issue
Block a user