Christian Halstrick <christian.halstrick@xxxxxxxxx> writes: > Question: > - is this because the index which jgit created is so corrupt that only > special commands > like "git status" can repair it? No. > - or is "git apply" not trying hard enough to consume a index with > smudged entries No. Lower level "plumbing" commands like "git apply" want to see the cached stat information in the index refreshed before they are called, instead of having to refresh the index themselves before starting to work, for performance reasons. Higher level "Porcelain" commands like "git status" on the other hand refreshes the index before they start to work. What you are seeing is a combination of * JGit not running its equivalent of "git update-index --refresh" before finishing and leaving the index file for you to look at. * "git status" running an equivalent of "git update-index --refresh" internally. * "git apply" not running "update-index --refresh" itself and instead expecting somebody else to have done so in the sequence of commands that it is a part of. The latter two is working perfectly as designed. I do not know what JGit wanted to do to leave the index in that state, so I cannot judge if that is a reasonable thing to do or JGit needs tobe fixed.