trackingRemote function

Future<String?> trackingRemote({
  1. String? dir,
})

Get the tracking remote for the current branch.

Implementation

Future<String?> trackingRemote({String? dir}) async {
  final branch = await currentBranch(dir: dir);
  if (branch == null) return null;

  final result = await runGit([
    'config',
    'branch.$branch.remote',
  ], workingDirectory: dir);
  return result.success ? result.output : null;
}