Skip to content

Commit 68d7282

Browse files
committed
Fixes failed git commands from sticking in the queue
1 parent 0b85adc commit 68d7282

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/git/git.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,18 @@ async function gitCommandCore(options: GitCommandOptions, ...args: any[]): Promi
8484
Logger.log(`Awaiting${command}`);
8585
}
8686

87-
const s = await promise;
88-
pendingCommands.delete(command);
89-
90-
Logger.log(`Completed${command}`);
87+
let data: string;
88+
try {
89+
data = await promise;
90+
}
91+
finally {
92+
pendingCommands.delete(command);
93+
Logger.log(`Completed${command}`);
94+
}
9195

92-
if (opts.encoding === 'utf8' || opts.encoding === 'binary') return s;
96+
if (opts.encoding === 'utf8' || opts.encoding === 'binary') return data;
9397

94-
return iconv.decode(Buffer.from(s, 'binary'), opts.encoding);
98+
return iconv.decode(Buffer.from(data, 'binary'), opts.encoding);
9599
}
96100

97101
function gitCommandDefaultErrorHandler(ex: Error, options: GitCommandOptions, ...args: any[]): string {

0 commit comments

Comments
 (0)