hasUnpushedCommits function

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

Check if there are unpushed commits.

Implementation

Future<bool> hasUnpushedCommits({String? cwd}) async {
  final result = await _runGit(['rev-list', '--count', '@{u}..HEAD'], cwd: cwd);
  return result.code == 0 && (int.tryParse(result.stdout.trim()) ?? 0) > 0;
}