File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -348,10 +348,15 @@ function getGitErrorCode(stderr: string): string | undefined {
348
348
return undefined ;
349
349
}
350
350
351
- // https://github.com/microsoft/vscode/issues/89373
352
- // https://github.com/git-for-windows/git/issues/2478
353
351
function sanitizePath ( path : string ) : string {
354
- return path . replace ( / ^ ( [ a - z ] ) : \\ / i, ( _ , letter ) => `${ letter . toUpperCase ( ) } :\\` ) ;
352
+ return path
353
+ // Drive letter
354
+ // https://github.com/microsoft/vscode/issues/89373
355
+ // https://github.com/git-for-windows/git/issues/2478
356
+ . replace ( / ^ ( [ a - z ] ) : \\ / i, ( _ , letter ) => `${ letter . toUpperCase ( ) } :\\` )
357
+ // Shell-sensitive characters
358
+ // https://github.com/microsoft/vscode/issues/133566
359
+ . replace ( / ( [ " ' \\ \$ ! > < # ( ) \[ \] * & ^ | ; { } ? ` ] ) / g, '\\$1' ) ;
355
360
}
356
361
357
362
const COMMIT_FORMAT = '%H%n%aN%n%aE%n%at%n%ct%n%P%n%D%n%B' ;
You can’t perform that action at this time.
0 commit comments