From 0e8d9f459e3b16f80fc6eb4646ae33215535b71f Mon Sep 17 00:00:00 2001 From: Thomas Boop <thboop@github.com> Date: Thu, 10 Sep 2020 17:22:02 -0400 Subject: [PATCH] Remove unneeded commit information from stdout --- dist/index.js | 5 +++-- src/git-command-manager.ts | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index ae64f3f..7f8c7d7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5885,7 +5885,7 @@ class GitCommandManager { } log1() { return __awaiter(this, void 0, void 0, function* () { - const output = yield this.execGit(['log', '-1']); + const output = yield this.execGit(['log', '-1'], false, true); return output.stdout; }); } @@ -6007,7 +6007,7 @@ class GitCommandManager { return result; }); } - execGit(args, allowAllExitCodes = false) { + execGit(args, allowAllExitCodes = false, silent = false) { return __awaiter(this, void 0, void 0, function* () { fshelper.directoryExistsSync(this.workingDirectory, true); const result = new GitOutput(); @@ -6022,6 +6022,7 @@ class GitCommandManager { const options = { cwd: this.workingDirectory, env, + silent, ignoreReturnCode: allowAllExitCodes, listeners: { stdout: (data) => { diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 059e3d8..bbfd870 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -255,7 +255,7 @@ class GitCommandManager { } async log1(): Promise<string> { - const output = await this.execGit(['log', '-1']) + const output = await this.execGit(['log', '-1'], false, true) return output.stdout } @@ -390,7 +390,8 @@ class GitCommandManager { private async execGit( args: string[], - allowAllExitCodes = false + allowAllExitCodes = false, + silent = false ): Promise<GitOutput> { fshelper.directoryExistsSync(this.workingDirectory, true) @@ -409,6 +410,7 @@ class GitCommandManager { const options = { cwd: this.workingDirectory, env, + silent, ignoreReturnCode: allowAllExitCodes, listeners: { stdout: (data: Buffer) => {