mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
SCM - getParent() should handle resource groups (#213350)
This commit is contained in:
parent
994893cbba
commit
36d917472f
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue