Fixed check for .git being a file or directory