Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't limit the output from exec #596

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ export interface IGitExecutionOptions {
readonly encoding?: BufferEncoding | 'buffer'

/**
* The size the output buffer to allocate to the spawned process. Set this
* if you are anticipating a large amount of output.
* Largest amount of data in bytes allowed on stdout or stderr. If exceeded,
* the child process is terminated and any output is truncated.
*
* If not specified, this will be 10MB (10485760 bytes) which should be
* enough for most Git operations.
* See https://nodejs.org/docs/latest-v22.x/api/child_process.html#maxbuffer-and-unicode
*
* If not specified the default is Infinity, i.e. the only limit is the amount
* of allocatable memory on the system.
*/
readonly maxBuffer?: number

Expand Down Expand Up @@ -134,7 +136,7 @@ export function exec(
cwd: path,
env,
encoding: options?.encoding ?? 'utf8',
maxBuffer: options ? options.maxBuffer : 10 * 1024 * 1024,
maxBuffer: options?.maxBuffer ?? Infinity,
signal: options?.signal,
killSignal: options?.killSignal,
}
Expand Down
Loading