From b71ede64c13ed59414c9bb4ef8627daa00a3bf7e Mon Sep 17 00:00:00 2001 From: Andrey Sinitsyn Date: Fri, 16 Oct 2020 16:26:15 +0300 Subject: [PATCH] fix(git): fatal when adding, reverting files or cleaning repo on win32 (#108691) Fixes issue #108690 --- extensions/git/src/git.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 48e5c457c22..d3c574c74b1 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -1233,7 +1233,7 @@ export class Repository { } if (paths && paths.length) { - for (const chunk of splitInChunks(paths, MAX_CLI_LENGTH)) { + for (const chunk of splitInChunks(paths.map(sanitizePath), MAX_CLI_LENGTH)) { await this.run([...args, '--', ...chunk]); } } else { @@ -1455,7 +1455,7 @@ export class Repository { const args = ['clean', '-f', '-q']; for (const paths of groups) { - for (const chunk of splitInChunks(paths, MAX_CLI_LENGTH)) { + for (const chunk of splitInChunks(paths.map(sanitizePath), MAX_CLI_LENGTH)) { promises.push(limiter.queue(() => this.run([...args, '--', ...chunk]))); } } @@ -1495,7 +1495,7 @@ export class Repository { try { if (paths && paths.length > 0) { - for (const chunk of splitInChunks(paths, MAX_CLI_LENGTH)) { + for (const chunk of splitInChunks(paths.map(sanitizePath), MAX_CLI_LENGTH)) { await this.run([...args, '--', ...chunk]); } } else {