prepareFiles method
Implementation
Future<GitContext> prepareFiles() async {
final context = GitContextSetter();
try {
context.partiallyStagedFiles = await partiallyStagedFiles();
if (context.partiallyStagedFiles case final partially
when partially.isNotEmpty) {
logger
.detail('Preparing partial files for patch (${partially.length})');
for (final file in partially) {
logger.detail(' $file');
}
final filePaths = processRenames(partially);
logger.detail('Processed files (${partially.length})');
for (final file in filePaths) {
logger.detail(' $file');
}
}
context
..deletedFiles = await deletedFiles()
..nonStagedFiles = await nonStagedFiles();
} catch (e) {
logger
..err('Failed to prepare files')
..detail('Error: $e');
throw Exception('Failed to prepare files');
}
return context;
}