From cc3b2ff7d61745ee9d901a3dd1871d23554e19e9 Mon Sep 17 00:00:00 2001 From: Ramin Tadayon Date: Tue, 26 Sep 2023 18:30:02 -0700 Subject: [PATCH] Fixes matching repo in path mapping for deep link when already open --- src/uris/deepLinks/deepLinkService.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/uris/deepLinks/deepLinkService.ts b/src/uris/deepLinks/deepLinkService.ts index d59c710..0562aa8 100644 --- a/src/uris/deepLinks/deepLinkService.ts +++ b/src/uris/deepLinks/deepLinkService.ts @@ -478,8 +478,22 @@ export class DeepLinkService implements Disposable { remoteUrl: remoteUrl, }); if (matchingLocalRepoPaths.length > 0) { - action = DeepLinkServiceAction.RepoMatchedInLocalMapping; - break; + for (const repo of this.container.git.repositories) { + if ( + matchingLocalRepoPaths.some( + p => normalizePath(repo.path.toLowerCase()) === normalizePath(p.toLowerCase()), + ) + ) { + this._context.repo = repo; + action = DeepLinkServiceAction.RepoMatched; + break; + } + } + + if (this._context.repo == null) { + action = DeepLinkServiceAction.RepoMatchedInLocalMapping; + break; + } } }