Fix temp file locking issues in tests
Fix temp file locking issues in tests

We were not properly mocking out the git initialization in the test so
this could cause issues in CI when multiple threads attempt to use the
same folder. This change mocks out the git initialization and adds
coverage for the git initialization function.

Change-Id: I5e6cd6cead12da8df8b366e4aa83d7c63d722369
Closes-Bug: #1796745

openstack/tripleo-common,openstack/tripleo-common