Interface Execution

A set of configuration options that can be passed when executing a low-level Git command.

interface Execution {
    env?: Object;
    expectedErrors?: readonly GitError[];
    maxBuffer?: number;
    name?: string;
    processCallback?: ((process) => void);
    stdin?: string;
    stdinEncoding?: string;
    successExitCodes?: readonly number[];
}

Properties

env?: Object

An optional collection of key-value pairs which will be set as environment variables before executing the Git process.

expectedErrors?: readonly GitError[]

The Git errors which are expected by the caller. Unexpected errors will be logged and an error thrown.

maxBuffer?: number

The size the output buffer to allocate to the spawned process. Set this if you are anticipating a large amount of output.

If not specified, this will be 10MB (10485760 bytes) which should be enough for most Git operations.

name?: string

The name for the command based on its caller's context. This could be used only for performance measurements and debugging. It has no runtime behavior effects.

processCallback?: ((process) => void)

An optional callback which will be invoked with the child process instance after spawning the Git process.

Note that if the stdin parameter was specified the stdin stream will be closed by the time this callback fires.

Defining this property could make the exec function invocation non-client compatible.

Type declaration

    • (process): void
    • Parameters

      • process: ChildProcess

      Returns void

stdin?: string

An optional string which will be written to the child process stdin stream immediately after spawning the process.

stdinEncoding?: string

The encoding to use when writing to stdin, if the stdin parameter is a string.

successExitCodes?: readonly number[]

The exit codes which indicate success to the caller. Unexpected exit codes will be logged and an error thrown. Defaults to 0 if undefined.