From a6e855409d06012aeebb57b5c05399e58b52a6cd Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 31 Jul 2020 01:34:46 -0400 Subject: [PATCH] Fixes "Inefficient regular expression" https://github.com/eamodio/vscode-gitlens/security/code-scanning/2 --- src/git/git.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git/git.ts b/src/git/git.ts index b1a2f58..f56609f 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -1026,7 +1026,7 @@ export namespace Git { ); // Make sure to normalize: https://github.com/git-for-windows/git/issues/2478 // Keep trailing spaces which are part of the directory name - return data.length === 0 ? undefined : Strings.normalizePath(data.trimLeft().replace(/(\r\n|\r|\n)+$/, '')); + return data.length === 0 ? undefined : Strings.normalizePath(data.trimLeft().replace(/[\r|\n]+$/, '')); } catch (ex) { if (ex.code === 'ENOENT') { // If the `cwd` doesn't exist, walk backward to see if any parent folder exists