From: Junio C Hamano Date: Sat, 01 Apr 2017 17:47:23 GMT Subject: Re: [PATCH 1/2] sha1_loose_object_info: return error for corrupted objects Message-ID: In-Reply-To: <20170401080521.ehjc6jomjd5py3lj@sigill.intra.peff.net> Jeff King 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. Thanks for a nice analysis and a fix.