diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index 7e697bd..e1ee276 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -582,6 +582,9 @@ export class GitProviderService implements Disposable { private _discoveredWorkspaceFolders = new Map>(); private _isDiscoveringRepositories: Promise | undefined; + get isDiscoveringRepositories(): Promise | undefined { + return this._isDiscoveringRepositories; + } @log({ args: { 0: folders => folders.length } }) async discoverRepositories(folders: readonly WorkspaceFolder[], options?: { force?: boolean }): Promise { diff --git a/src/uris/deepLinks/deepLinkService.ts b/src/uris/deepLinks/deepLinkService.ts index f7f224b..c5d65ce 100644 --- a/src/uris/deepLinks/deepLinkService.ts +++ b/src/uris/deepLinks/deepLinkService.ts @@ -44,6 +44,10 @@ export class DeepLinkService implements Disposable { if (link == null) return; if (this._context.state === DeepLinkServiceState.Idle) { + if (this.container.git.isDiscoveringRepositories) { + await this.container.git.isDiscoveringRepositories; + } + if (!link.type || (!link.repoId && !link.remoteUrl && !link.repoPath)) { void window.showErrorMessage('Unable to resolve link'); Logger.warn(`Unable to resolve link - missing basic properties: ${uri.toString()}`); @@ -126,6 +130,10 @@ export class DeepLinkService implements Disposable { let action = DeepLinkServiceAction.OpenRepo; + if (this.container.git.isDiscoveringRepositories) { + await this.container.git.isDiscoveringRepositories; + } + if (pendingDeepLink.repoPath != null) { const repoOpenUri = Uri.parse(pendingDeepLink.repoPath); try {