deleteFileAndCommit function
Deletes and commits a file
Implementation
Future<void> deleteFileAndCommit(Directory testDir, String fileName) async {
// Delete the file
final file = File('${testDir.path}/$fileName');
if (await file.exists()) {
await file.delete();
}
// Stage deletion
final result0 = await Process.run('git', [
'rm',
fileName,
], workingDirectory: testDir.path);
_throw('Could execute »git rm $fileName«', result0);
// Commit deletion
await commitFile(testDir, fileName, stage: false);
}