Change the check for the existence of .git directory.

In common setup the check for the .git directory is too
restrictive. Instead of checking that it is a directory just
check to see if it exists. That way if the project is part
of a submodule it will continue to work correctly.

Change-Id: If6b6531ab5778ac17537e3f18bde1844620c8316
Fixes: bug 1126416