Git - do not try to resolve workspace folders that do not use the file scheme (#173546)

This commit is contained in:
Ladislau Szomoru
2023-02-06 12:33:06 +01:00
committed by GitHub
parent 7b369be6af
commit 01f32e6a44

View File

@@ -788,11 +788,14 @@ export class Model implements IRemoteSourcePublisherRegistry, IPostCommitCommand
}
private async isRepositoryOutsideWorkspace(repositoryPath: string): Promise<boolean> {
if (!workspace.workspaceFolders || workspace.workspaceFolders.length === 0) {
const workspaceFolders = (workspace.workspaceFolders || [])
.filter(folder => folder.uri.scheme === 'file');
if (workspaceFolders.length === 0) {
return true;
}
const result = await Promise.all(workspace.workspaceFolders.map(async folder => {
const result = await Promise.all(workspaceFolders.map(async folder => {
const workspaceFolderRealPath = await this.getWorkspaceFolderRealPath(folder);
return workspaceFolderRealPath ? pathEquals(workspaceFolderRealPath, repositoryPath) || isDescendant(workspaceFolderRealPath, repositoryPath) : undefined;
}));