Jeff King <peff@xxxxxxxx> writes: > It should be easy enough to check that; the patch below implements it. > I couldn't measure any speedup with it running "git ls-files >/dev/null" > on linux.git (60k files). But nor could I get any by dropping the check > entirely. I would expect that the speedup (due to possible cache effect) wouldn't be measurable if the overhead of the existing check itself is unmeasuably not-expensive. No suprise here. > This is mostly just a curiosity to me. For the record, I have no real > problem with dropping this kind of on-disk data-structure validation > when it's expensive. After all, we do not check the sort on pack .idx > files on each run (nor pack sha1 checksums, etc) because it's too > expensive to do so. Yes, I agree with that stance, too. If this were expensive in the overall picture to be measurable, I think we are OK omitting when the index is read, especially if we make sure we are not writing out nonsense trees out of it. Local damage to the index is very contained as long as we do not spread breakages to trees and commits.