list-objects.c: handle unexpected non-blob entries
authorTaylor Blau <redacted>
Wed, 10 Apr 2019 02:13:17 +0000 (19:13 -0700)
committerJunio C Hamano <redacted>
Wed, 10 Apr 2019 03:59:39 +0000 (12:59 +0900)
commit23c204455bf2198806e8c7b0cd86b20a50a379d0
tree53bcb4f59c3793bd98ecbe24206121a3b6561f10
parent0616617c7e1470e11c10dcb0fb72100ce3b15ec4
list-objects.c: handle unexpected non-blob entries

Fix one of the cases described in the previous commit where a tree-entry
that is promised to a blob is in fact a non-blob.

When 'lookup_blob()' returns NULL, it is because Git has cached the
requested object as a non-blob. In this case, prevent a SIGSEGV by
'die()'-ing immediately before attempting to dereference the result.

Signed-off-by: Taylor Blau <redacted>
Signed-off-by: Junio C Hamano <redacted>
list-objects.c
t/t6102-rev-list-unexpected-objects.sh
git clone https://git.99rst.org/PROJECT