getCreated static method

Future<DateTime?> getCreated(
  1. File file
)

Get date when file was first tracked in git history.

Implementation

static Future<DateTime?> getCreated(File file) async {
  if (!await isGitInstalled()) {
    return null;
  }
  if (!await isGitDir()) {
    return null;
  }

  final result = await _shell.run(
    'git log --diff-filter=A --follow --format=%aI -1 -- ${file.path}',
  );

  return _parseOutput(result.outText);
}