RecordingGitRunner class

A recording GitRunner: records every git argv (with its cwd) in order, and returns a configurable result so commit/push read ok. Wrap it in the real GitOps so the land step's real add -A / commit -m / push -u argv is what gets recorded (Fakes, not mocks).

Constructors

RecordingGitRunner()

Properties

calls List<({List<String> args, String workDir})>
Every (workDir, args) git invocation, in call order.
final
exitCode int
The exit code the next runs return (0 ⇒ ok). Settable so a test can make a step fail.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subcommands List<String>
The flattened leading subcommands of every recorded git call, in order (['add', 'commit', 'push'] for a clean land).
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run({required String workingDirectory, required List<String> args}) Future<GitRunResult>
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.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited