Fix ignoring changes in .git and .hg directories