getBranch function

Future<String> getBranch({
  1. String? cwd,
})

Get current branch name.

Implementation

Future<String> getBranch({String? cwd}) async {
  final result = await _runGit(['rev-parse', '--abbrev-ref', 'HEAD'], cwd: cwd);
  return result.stdout.trim();
}