run method

  1. @override
Future<GitRunResult> run({
  1. required String workingDirectory,
  2. required List<String> args,
})

Runs git [args] with workingDirectory as the cwd. The implementation MUST strip the gitEnvBlacklist keys from the inherited environment before exec (gc's clean-env build, git.go:314-320) so a parent GIT_DIR/GIT_WORK_TREE/… from a melos/hook context can never redirect the command to the wrong repository. Never throws — a launch failure is reported as GitRunResult.launched == false.

Implementation

@override
Future<GitRunResult> run({
  required String workingDirectory,
  required List<String> args,
}) async {
  calls.add((workDir: workingDirectory, args: List.unmodifiable(args)));
  return GitRunResult(exitCode: exitCode, output: '');
}