fix issue when scanning gitignore for files to ignore