diff options
author | Martin Koegler <mkoegler@auto.tuwien.ac.at> | 2008-02-18 21:48:02 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-18 19:25:26 -0800 |
commit | 9786f68bfcc082778aee74159540e341bb239514 (patch) | |
tree | d2a1d81c7d446a8199ca07d08fce9963270375f6 | |
parent | 9684afd967f61047bbf1b3a8039adf7d41916b31 (diff) | |
download | git-9786f68bfcc082778aee74159540e341bb239514.tar.gz git-9786f68bfcc082778aee74159540e341bb239514.tar.xz |
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>
-rw-r--r-- | commit.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -311,6 +311,8 @@ int parse_commit(struct commit *item) unsigned long size; int ret; + if (!item) + return -1; if (item->object.parsed) return 0; buffer = read_sha1_file(item->object.sha1, &type, &size); |