The error occurs (for files that are in the work-tree) if function ie_match_stat
fails to match the stat info. This particular call to ie_match_stat
passes CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE
as ie_match_stat
would normally obey the cache entry flags CE_VALID
or CE_SKIP_WORKTREE
by saying: the work-tree copy is up to date even if it's not. The sparse checkout code uses the skip-worktree flag (CE_SKIP_WORKTREE
) to mark files that should not be checked out, so that the rest of Git won't complain about them being missing.
Hence, the oddities here are:
- The skip-worktree bit is set on a file that is in the work-tree. Why?
- The index entry's cached
stat
data for the this file do not match the lstat
results from this file. Why?
The answer to the first question could be: because a user set it (using git update-index
). The answer to the second could be: because a user modified the file. So they're not particularly odd at all, they just imply that the file does not match whatever was created by an initial checkout or git read-tree
operation. If you don't care about losing the contents of the file, feel free to remove it. If you do care about the contents, clear the skip-worktree bit (git update-index --no-skip-worktree
), after which git diff
should show what's different.
There may well be some bugs in this area, especially in Git versions that are this ancient (Git 1.8.x—current Git is 2.22).