add check if .git is a directory
add check if .git is a directory

Fixes CMake error in string(SUBSTRING) if OSPRay is a git submodule

ospray/OSPRay,ospray/OSPRay,wilsonCernWq/ospray,ospray/OSPRay,wilsonCernWq/ospray,wilsonCernWq/ospray,ospray/OSPRay