]> git.ipfire.org Git - thirdparty/git.git/commit - list-objects.c
list-objects.c: handle unexpected non-blob entries
authorTaylor Blau <me@ttaylorr.com>
Wed, 10 Apr 2019 02:13:17 +0000 (19:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
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 <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
list-objects.c
t/t6102-rev-list-unexpected-objects.sh