commitFile function
Commit the file with a name in the test directory
Implementation
Future<void> commitFile(
Directory testDir,
String name, {
String message = 'Commit Message',
}) async {
await stageFile(testDir, name);
final result2 = await Process.run(
'git',
['commit', '-m', message],
workingDirectory: testDir.path,
);
if (result2.exitCode != 0) {
throw Exception('Could not commit $name.');
}
}