From bfb4f5fc1c0add3766e73dfdf676c2e193a7ca7a Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:18:17 +0100 Subject: [PATCH] Git - Revert "Git - escape shell-sensitive characters (#236849)" (#237388) Revert "Git - escape shell-sensitive characters (#236849)" This reverts commit fca210cd103a496f25c23786b861a67f4d1ee16b. --- extensions/git/src/git.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 0ca691fda64..dcb3b4eb65f 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -349,15 +349,10 @@ function getGitErrorCode(stderr: string): string | undefined { return undefined; } +// https://github.com/microsoft/vscode/issues/89373 +// https://github.com/git-for-windows/git/issues/2478 function sanitizePath(path: string): string { - return path - // Drive letter - // https://github.com/microsoft/vscode/issues/89373 - // https://github.com/git-for-windows/git/issues/2478 - .replace(/^([a-z]):\\/i, (_, letter) => `${letter.toUpperCase()}:\\`) - // Shell-sensitive characters - // https://github.com/microsoft/vscode/issues/133566 - .replace(/(["'\\\$!><#()\[\]*&^| ;{}?`])/g, '\\$1'); + return path.replace(/^([a-z]):\\/i, (_, letter) => `${letter.toUpperCase()}:\\`); } const COMMIT_FORMAT = '%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B';