瀏覽代碼

Fixes failed git commands from sticking in the queue

main
Eric Amodio 7 年之前
父節點
當前提交
68d7282aa8
共有 1 個文件被更改,包括 10 次插入6 次删除
  1. +10
    -6
      src/git/git.ts

+ 10
- 6
src/git/git.ts 查看文件

@ -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…
取消
儲存