Detect git repo with a faster call than git ls-files

The git ls-files call lists all the files in the repository.  That is
significantly more work than is really needed to answer the question
which is being asked.  The question asked by the API is "Is this a valid
git controlled working directory?"

The git rev-parse is-inside-work-tree command answers the same question
reliably and much faster than listing all the files in the repository.

This also adds three new unit tests to verify the behavior was preserved
from before the change to after the change.