Since you set bare like 4 or 5 different times in this test suite, why not pull this into a utility method, so you can just do:

  setBare(gitDir, true);

and have the setBare utility method create the temporary Repository, set the flag and save the config.