Re: [PATCH 1/2] sha1_loose_object_info: return error for corrupted objects
From: Junio C Hamano <hidden> Date: 2017-04-01 17:47:31
Jeff King [off-list ref] writes:
When sha1_loose_object_info() finds that a loose object file
cannot be stat(2)ed or mmap(2)ed, it returns -1 to signal an
error to the caller. However, if it found that the loose
object file is corrupt and the object data cannot be used
from it, it stuffs OBJ_BAD into "type" field of the
object_info, but returns zero (i.e., success), which can
confuse callers.