currentCommit function

Future<String?> currentCommit({
  1. String? dir,
  2. bool short = false,
})

Get the current commit hash.

Implementation

Future<String?> currentCommit({String? dir, bool short = false}) async {
  final result = await runGit([
    'rev-parse',
    if (short) '--short',
    'HEAD',
  ], workingDirectory: dir);
  return result.success ? result.output : null;
}