Make sure git environment is consistent for all test runs
This should make tests more repeatable across different environments.
Test Plan
Run tests with a non-empty .gitconfig, for instance having commit signing turned on
Migrated from D310 (view on Phabricator)