fix bug #2795 that crashes if git is not installed but .git directory exists