Skip to content

Commit

Permalink
SCM - getParent() should handle resource groups (#213350)
Browse files Browse the repository at this point in the history
  • Loading branch information
lszomoru authored May 24, 2024
1 parent 994893c commit 36d9174
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/vs/workbench/contrib/scm/browser/scmViewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 36d9174

Please sign in to comment.