Get file modes from the filesystem, not what git checkout-index writes. git checkout-index doesn't put the object's mode onto the extracted file (why not?!), so the old behaviour wound up with everything being taken as mode 644, which ends up chmoding anything we touch to 644.