hasCleanWorkingTree method

Future<bool> hasCleanWorkingTree(
  1. String projectPath
)

Returns true if working directory has no uncommitted changes.

Implementation

Future<bool> hasCleanWorkingTree(String projectPath) async {
  final result = await _runner.run(
    'git',
    ['status', '--porcelain'],
    workingDirectory: projectPath,
  );
  if (result.exitCode != 0) return false;
  return result.stdout.toString().trim().isEmpty;
}