getHistoricalFileContent method

Future<String> getHistoricalFileContent(
  1. String baseRef,
  2. String relativePath
)

Extracts the historical content of relativePath at baseRef from Git.

Implementation

Future<String> getHistoricalFileContent(
  String baseRef,
  String relativePath,
) async {
  final res = await _runGit(['show', '$baseRef:$relativePath']);
  if (res.exitCode != 0) {
    // File did not exist at base ref (Status A - newly added)
    return '';
  }
  return res.stdout as String;
}