The only place where you add stuff to 'ignoredPaths' is inside a block which we enter only if we don't find an entry in the index. What is with files which are listed in .gitignore but which have been added to the index before?

git init
echo a > a
git add a
git commit -m initial
echo b > b
git add b
echo b > .gitignore

When processing b dm would be different from 0 although b is ignored, or?