gitDiffFiles static method

String gitDiffFiles(
  1. File path0,
  2. FileSystemEntity path1
)

return the diff of two files

Implementation

static String gitDiffFiles(File path0, FileSystemEntity path1) {
  final processResult =
      Process.runSync('git', ['diff', '--no-index', path0.path, path1.path]);

  final stdoutString = processResult.stdout as String;
  final stderrString = processResult.stderr as String;

  final processString =
      stdoutString.isNotEmpty || stderrString.isNotEmpty ? stdoutString : '';

  return _stripGitDiff(processString);
}