Skip to content

Commit 5087fb8

Browse files
committed
Support all: false
1 parent 7b1c005 commit 5087fb8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎node-src/git/execGit.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ export async function execGitCommand(
3232
) {
3333
try {
3434
log.debug(`execGitCommand: ${command}`);
35-
const { all } = await runCommand(command, { ...defaultOptions, ...options });
35+
const { all, stdout } = await runCommand(command, { ...defaultOptions, ...options });
36+
// If the caller sets `all: false`, then `stdout` will be the output. Otherwise, `all` will
37+
// contain interleaved stdout and stderr.
38+
const output = all ?? stdout;
3639

37-
if (all === undefined) {
40+
if (output === undefined) {
3841
throw new Error(`Unexpected missing git command output for command: '${command}'`);
3942
}
4043

41-
const result = all.toString();
44+
const result = output.toString();
4245
log.debug(`execGitCommand result: '${result}'`);
4346
return result;
4447
} catch (error) {

0 commit comments

Comments
 (0)