diff --git a/src/vs/workbench/contrib/url/browser/trustedDomains.ts b/src/vs/workbench/contrib/url/browser/trustedDomains.ts index 16b960b94cc4f..c3310a3bbbfc2 100644 --- a/src/vs/workbench/contrib/url/browser/trustedDomains.ts +++ b/src/vs/workbench/contrib/url/browser/trustedDomains.ts @@ -144,16 +144,18 @@ export function extractGitHubRemotesFromGitConfig(gitConfig: string): string[] { async function getRemotes(fileService: IFileService, textFileService: ITextFileService, contextService: IWorkspaceContextService): Promise { const workspaceUris = contextService.getWorkspace().folders.map(folder => folder.uri); - const domains = await Promise.all(workspaceUris.map(async workspaceUri => { - const path = workspaceUri.path; - const uri = workspaceUri.with({ path: `${path !== '/' ? path : ''}/.git/config` }); - const exists = await fileService.exists(uri); - if (!exists) { - return []; - } - const gitConfig = (await (textFileService.read(uri, { acceptTextOnly: true }).catch(() => ({ value: '' })))).value; - return extractGitHubRemotesFromGitConfig(gitConfig); - })); + const domains = await Promise.race([ + new Promise(resolve => setTimeout(() => resolve([]), 250)), + Promise.all(workspaceUris.map(async workspaceUri => { + const path = workspaceUri.path; + const uri = workspaceUri.with({ path: `${path !== '/' ? path : ''}/.git/config` }); + const exists = await fileService.exists(uri); + if (!exists) { + return []; + } + const gitConfig = (await (textFileService.read(uri, { acceptTextOnly: true }).catch(() => ({ value: '' })))).value; + return extractGitHubRemotesFromGitConfig(gitConfig); + }))]); const set = domains.reduce((set, list) => list.reduce((set, item) => set.add(item), set), new Set()); return [...set];