Skip to content

Commit

Permalink
Fixes "Inefficient regular expression"
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Jul 31, 2020
1 parent 7283dae commit a6e8554
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/git/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a6e8554

Please sign in to comment.