mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
Merge commit 'refs/pull/66095/head' of github.com:microsoft/vscode into pr/66095
This commit is contained in:
commit
c769d8a08a
1 changed files with 55 additions and 6 deletions
|
@ -956,21 +956,70 @@ export class Repository implements Disposable {
|
|||
}
|
||||
});
|
||||
|
||||
const promises: Promise<void>[] = [];
|
||||
const maxCommandLineLength: number = 30000;
|
||||
|
||||
if (toClean.length > 0) {
|
||||
promises.push(this.repository.clean(toClean));
|
||||
let sliceStart: number = 0;
|
||||
let sliceEnd: number = 1;
|
||||
let accumulatedStringLength = 0;
|
||||
|
||||
while (sliceEnd < toClean.length) {
|
||||
if ((accumulatedStringLength + (toClean[sliceEnd - 1].length + 1)) > maxCommandLineLength) {
|
||||
await this.repository.clean(toClean.slice(sliceStart, sliceEnd));
|
||||
sliceStart = sliceEnd;
|
||||
sliceEnd++;
|
||||
accumulatedStringLength = 0;
|
||||
}
|
||||
else {
|
||||
accumulatedStringLength += toClean[sliceEnd - 1].length + 1;
|
||||
sliceEnd++;
|
||||
}
|
||||
}
|
||||
|
||||
await this.repository.clean(toClean.slice(sliceStart, sliceEnd));
|
||||
}
|
||||
|
||||
if (toCheckout.length > 0) {
|
||||
promises.push(this.repository.checkout('', toCheckout));
|
||||
let sliceStart: number = 0;
|
||||
let sliceEnd: number = 1;
|
||||
let accumulatedStringLength = 0;
|
||||
|
||||
while (sliceEnd < toCheckout.length) {
|
||||
if ((accumulatedStringLength + (toCheckout[sliceEnd - 1].length + 1)) > maxCommandLineLength) {
|
||||
await this.repository.checkout('', toCheckout.slice(sliceStart, sliceEnd));
|
||||
sliceStart = sliceEnd;
|
||||
sliceEnd++;
|
||||
accumulatedStringLength = 0;
|
||||
}
|
||||
else {
|
||||
accumulatedStringLength += toCheckout[sliceEnd - 1].length + 1;
|
||||
sliceEnd++;
|
||||
}
|
||||
}
|
||||
|
||||
await this.repository.checkout('', toCheckout.slice(sliceStart, sliceEnd));
|
||||
}
|
||||
|
||||
if (submodulesToUpdate.length > 0) {
|
||||
promises.push(this.repository.updateSubmodules(submodulesToUpdate));
|
||||
}
|
||||
let sliceStart: number = 0;
|
||||
let sliceEnd: number = 1;
|
||||
let accumulatedStringLength = 0;
|
||||
|
||||
await Promise.all(promises);
|
||||
while (sliceEnd < submodulesToUpdate.length) {
|
||||
if ((accumulatedStringLength + (submodulesToUpdate[sliceEnd - 1].length + 1)) > maxCommandLineLength) {
|
||||
await this.repository.updateSubmodules(submodulesToUpdate.slice(sliceStart, sliceEnd));
|
||||
sliceStart = sliceEnd;
|
||||
sliceEnd++;
|
||||
accumulatedStringLength = 0;
|
||||
}
|
||||
else {
|
||||
accumulatedStringLength += submodulesToUpdate[sliceEnd - 1].length + 1;
|
||||
sliceEnd++;
|
||||
}
|
||||
}
|
||||
|
||||
await this.repository.updateSubmodules(submodulesToUpdate.slice(sliceStart, sliceEnd));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue