Fix the check for the .git and .cvs directory