Git - Extract querying for status so that it can run in parallel with the other operations (#163990)

This commit is contained in:
Ladislau Szomoru
2022-10-20 13:37:04 +02:00
committed by GitHub
parent 76191c7c75
commit 2fa61a14b8
2 changed files with 68 additions and 59 deletions

View File

@@ -1954,7 +1954,7 @@ export class Repository {
const child = this.stream(args, { env });
const onExit = (exitCode: number) => {
const onClose = (exitCode: number) => {
if (exitCode !== 0) {
const stderr = stderrData.join('');
return e(new GitError({
@@ -1975,7 +1975,7 @@ export class Repository {
parser.update(raw);
if (limit !== 0 && parser.status.length > limit) {
child.removeListener('exit', onExit);
child.removeListener('close', onClose);
child.stdout!.removeListener('data', onStdoutData);
child.kill();
@@ -1991,7 +1991,7 @@ export class Repository {
child.stderr!.on('data', raw => stderrData.push(raw as string));
child.on('error', cpErrorHandler(e));
child.on('exit', onExit);
child.on('close', onClose);
});
}