Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git - don't use look-behind regex #236447

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Git - don't use look-behind regex
  • Loading branch information
lszomoru committed Dec 18, 2024
commit 84713541501e37b60619d0d837f3648e0d6dccbb
2 changes: 1 addition & 1 deletion extensions/git/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export class Git {
const repoUri = Uri.file(repositoryRootPath);
const pathUri = Uri.file(pathInsidePossibleRepository);
if (repoUri.authority.length !== 0 && pathUri.authority.length === 0) {
const match = /(?<=^\/?)([a-zA-Z])(?=:\/)/.exec(pathUri.path);
const match = /^[\/]?([a-zA-Z])[:\/]/.exec(pathUri.path);
if (match !== null) {
const [, letter] = match;

Expand Down
Loading