File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -596,11 +596,10 @@ export abstract class ViewBase<
596596 private addHeaderNode ( node : ViewNode , promise : ViewNode [ ] | Promise < ViewNode [ ] > ) : ViewNode [ ] | Promise < ViewNode [ ] > {
597597 if ( node !== this . root ) return promise ;
598598
599+ const { openRepositories : repos } = this . container . git ;
600+
599601 // If we are not grouped and we are either not filterable or there aren't multiple repos open, then just return the promise
600- if (
601- ! this . grouped &&
602- ( ! this . isAny ( ...treeViewTypesSupportsRepositoryFilter ) || this . container . git . openRepositories . length <= 1 )
603- ) {
602+ if ( ! this . grouped && ( ! this . isAny ( ...treeViewTypesSupportsRepositoryFilter ) || repos . length <= 1 ) ) {
604603 return promise ;
605604 }
606605
@@ -627,6 +626,16 @@ export abstract class ViewBase<
627626 return children ;
628627 } ;
629628
629+ if ( ! this . grouped && this . supportsWorktreeCollapsing ) {
630+ return groupRepositories ( repos ) . then ( grouped => {
631+ if ( grouped . size <= 1 ) return promise ;
632+
633+ return isPromise ( promise )
634+ ? promise . then ( c => ensureGroupedHeaderNode ( c ) )
635+ : ensureGroupedHeaderNode ( promise ) ;
636+ } ) ;
637+ }
638+
630639 return isPromise ( promise ) ? promise . then ( c => ensureGroupedHeaderNode ( c ) ) : ensureGroupedHeaderNode ( promise ) ;
631640 }
632641
You can’t perform that action at this time.
0 commit comments