Do not throw exception if not in git repo

This fixes an issue where the build mojo would throw an exception it
was run from a directory that wasn't a git repo. This would happen even
if you weren't using git commit IDs for tags.

We now throw an exception only if the useGitCommitId flag is true and
you're not in a git repo.