getChangedFiles function
Get a list of changed files (porcelain output).
Implementation
Future<List<String>> getChangedFiles({String? cwd}) async {
final result = await _runGit([
'--no-optional-locks',
'status',
'--porcelain',
], cwd: cwd);
return result.stdout.trim().split('\n').where((line) => line.isNotEmpty).map((
line,
) {
final trimmed = line.trim();
final spaceIdx = trimmed.indexOf(' ');
return spaceIdx >= 0 ? trimmed.substring(spaceIdx + 1).trim() : trimmed;
}).toList();
}