Subject: Re: [PATCH v6 17/19] fsck: Introduce `git fsck --quick`

From: Junio C Hamano <[email-masked]>
Date: Sun, 21 Jun 2015 13:46:44 -0700

Junio C Hamano <[email-masked]> writes:

> Of course, that assumes that you can tell an object is a blob
> without unpacking.  If a tree entry mentions an object to be a blob
> by having 100644 as its mode, unless you unpack the object pointed
> at by that tree entry to make sure it is a blob, you wouldn't be
> able to detect a case where a non-blob object is stored with 100644
> mode, which would be an error in the containing tree object that we
> may want to detect.

Heh, I was being stupid here.  Of course, you can tell an object is
a blob without fully inflating it (we should already be doing that
in sha1_object_info(), inflating only the object header in loose
objects or inflating only the early parts of delta in packs to
follow the delta chain to learn the type of the object), and that
would certainly save us substantial zlib cost.

Sorry about the noise.