getCreated static method
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);
}