tests: set git config using git config for simplicity
I also took the liberty to not set the same config value twice as we did before.
Differential Revision: https://phab.mercurial-scm.org/D9176