Johannes Schindelin schrieb:
The problem is that the index has the same timestamp as the file "foo".
Therefore, git cannot tell if "foo" is up-to-date in the index, since it
could have been modified (and indeed is) just a fraction of a second later
than the index was last updated.
The test goes like this:
>foo && git add foo && git commit -a -m "commit all" &&
test -z "`git diff-index HEAD -- foo`" &&
git read-tree HEAD &&
case "`git diff-index HEAD -- foo`" in
:100644" "*"M foo") echo ok;;
*) echo fail; (exit 1);;
esac &&
git add --refresh -- foo &&
test -z "`git diff-index HEAD -- foo`"
I'm pretty sure that this test completed within one second even before
git-commit was a builtin. (I assume that timestamps don't have sub-second
resolution.) Why then didn't this racy-git problem occur with the scripted
git-commit?
-- Hannes
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html