Fix for #2739 (and #1755), added support for directory excludes in the .gitignore file like /directory or directory/