Fix #122277 - Trusted domains getRemotes call errors in virtual folder
This commit is contained in:
parent
6902f8bfaf
commit
ebe08a2e52
1 changed files with 10 additions and 6 deletions
|
@ -156,14 +156,18 @@ async function getRemotes(fileService: IFileService, textFileService: ITextFileS
|
|||
const domains = await Promise.race([
|
||||
new Promise<string[][]>(resolve => setTimeout(() => resolve([]), 2000)),
|
||||
Promise.all<string[]>(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) {
|
||||
try {
|
||||
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);
|
||||
} catch {
|
||||
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<string>());
|
||||
|
|
Loading…
Reference in a new issue