createBranch function

Future<void> createBranch(
  1. Directory testDir,
  2. String branchName
)

Creates a branch in the git repo in testDir

Implementation

Future<void> createBranch(Directory testDir, String branchName) async {
  final result = await Process.run('git', [
    'checkout',
    '-b',
    branchName,
  ], workingDirectory: testDir.path);

  _throw('Could not create branch $branchName', result);
}