updated check for git-repository

prevents error output of missing .git-directory.