Browse Source

Fixes failed git commands from sticking in the queue

main
Eric Amodio 7 years ago
parent
commit
68d7282aa8
1 changed files with 10 additions and 6 deletions
  1. +10
    -6
      src/git/git.ts

+ 10
- 6
src/git/git.ts View File

@ -84,14 +84,18 @@ async function gitCommandCore(options: GitCommandOptions, ...args: any[]): Promi
Logger.log(`Awaiting${command}`);
}
const s = await promise;
pendingCommands.delete(command);
Logger.log(`Completed${command}`);
let data: string;
try {
data = await promise;
}
finally {
pendingCommands.delete(command);
Logger.log(`Completed${command}`);
}
if (opts.encoding === 'utf8' || opts.encoding === 'binary') return s;
if (opts.encoding === 'utf8' || opts.encoding === 'binary') return data;
return iconv.decode(Buffer.from(s, 'binary'), opts.encoding);
return iconv.decode(Buffer.from(data, 'binary'), opts.encoding);
}
function gitCommandDefaultErrorHandler(ex: Error, options: GitCommandOptions, ...args: any[]): string {

Loading…
Cancel
Save