Git trusts cached stat data to skip reading files. An edit in the same second as an index write can look clean. Here is how Git catches it, with a script.