initLocalGit function
Init local git repository in directory
Implementation
Future<void> initLocalGit(Directory testDir) async {
_setupGitHub(testDir);
final localDir = testDir;
final result = await Process.run('git', [
'init',
'--initial-branch=main',
], workingDirectory: localDir.path);
_throw('Could not initialize local git repository', result);
final result2 = await Process.run('git', [
'checkout',
'-b',
'main',
], workingDirectory: localDir.path);
_throw('Could not create main branch', result2);
}