@@ -30,24 +30,28 @@ export class UiService implements IUiService {
3030 return modeChoice . label === allBranches ? BranchSelection . All : BranchSelection . Current ;
3131 }
3232 public async getWorkspaceFolder ( uri ?: Uri ) : Promise < WorkspaceGitRoot | undefined > {
33- let workspaceFolder : string | undefined ;
33+ let workspaceFolder : Uri | undefined ;
3434 const workspaceService = this . serviceContainer . get < IWorkspaceService > ( IWorkspaceService ) ;
3535 if ( uri ) {
3636 const workspaceFolderUri = workspaceService . getWorkspaceFolder ( uri ) ;
3737 if ( workspaceFolderUri ) {
38- workspaceFolder = workspaceFolderUri . uri . fsPath ;
38+ workspaceFolder = workspaceFolderUri . uri ;
3939 }
4040 }
4141 if ( ! Array . isArray ( workspaceService . workspaceFolders ) || workspaceService . workspaceFolders . length === 0 ) {
4242 this . serviceContainer . get < IApplicationShell > ( IApplicationShell ) . showInformationMessage ( 'Please open a workspace folder' ) ;
4343 return ;
4444 }
4545
46- const firstWorkspaceFolder = workspaceService . workspaceFolders [ 0 ] ! . uri . fsPath ;
47- const gitService = await this . serviceContainer . get < IGitServiceFactory > ( IGitServiceFactory ) . createGitService ( firstWorkspaceFolder , firstWorkspaceFolder ) ;
48- const gitRoots = await gitService . getGitRoots ( workspaceFolder ) ;
46+ const firstWorkspaceFolder = workspaceService . workspaceFolders [ 0 ] . uri . fsPath ;
47+ const folders = workspaceFolder ? [ workspaceFolder ] : workspaceService . workspaceFolders . map ( item => item . uri ) ;
48+ const gitServices = await Promise . all ( folders . map ( async folder => {
49+ const gitService = await this . serviceContainer . get < IGitServiceFactory > ( IGitServiceFactory ) . createGitService ( folder . fsPath , folder ) ;
50+ return gitService . getGitRoots ( folder . fsPath ) ;
51+ } ) ) ;
52+ const flattendGitServices = gitServices . reduce ( ( a , b ) => a . concat ( b ) , [ ] ) ;
4953 // Filter to get only those that belong to a workspace folder
50- const filteredGitRoots = gitRoots
54+ const filteredGitRoots = flattendGitServices
5155 . map ( gitRoot => {
5256 const workspaceFolderUri = workspaceService . getWorkspaceFolder ( Uri . file ( gitRoot ) ) ;
5357 if ( workspaceFolderUri ) {
0 commit comments