SCM - getParent() should handle resource groups (#213350)

This commit is contained in:
Ladislau Szomoru 2024-05-24 07:09:47 +00:00 committed by GitHub
parent 994893cbba
commit 36d917472f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3850,6 +3850,13 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
return result;
} else if (isSCMInput(element)) {
return element.repository;
} else if (isSCMResourceGroup(element)) {
const repository = this.scmViewService.visibleRepositories.find(r => r.provider === element.provider);
if (!repository) {
throw new Error('Invalid element passed to getParent');
}
return repository;
} else {
throw new Error('Unexpected call to getParent');
}