Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 228a80f

Browse files
committed
Looks like we get an exit code of 1 on Windows
1 parent 31c4c1e commit 228a80f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/git-shell-out-strategy.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,12 @@ export default class GitShellOutStrategy {
130130
}
131131
return new Promise(async (resolve, reject) => {
132132
const {promise, cancel} = this.executeGitCommand(args, options, timingMarker);
133+
let expectCancel = false;
133134
if (gitPromptServer) {
134-
subscriptions.add(gitPromptServer.onDidCancel(cancel));
135+
subscriptions.add(gitPromptServer.onDidCancel(() => {
136+
expectCancel = true;
137+
cancel();
138+
}));
135139
}
136140

137141
const {stdout, stderr, exitCode, timing} = await promise;
@@ -164,7 +168,7 @@ export default class GitShellOutStrategy {
164168
console.groupEnd();
165169
}
166170

167-
if (exitCode) {
171+
if (exitCode !== 0 && !expectCancel) {
168172
const err = new GitError(
169173
`${formattedArgs} exited with code ${exitCode}\nstdout: ${stdout}\nstderr: ${stderr}`,
170174
);

0 commit comments

Comments
 (0)