File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/vs/workbench/contrib/scm/browser Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -373,18 +373,24 @@ export class SCMViewService implements ISCMViewService {
373373 }
374374
375375 let added : Iterable < ISCMRepository > = Iterable . empty ( ) ;
376- const repositoryView = this . _repositories . splice ( repositoriesIndex , 1 ) ;
376+ const removed = this . _repositories . splice ( repositoriesIndex , 1 ) ;
377377
378378 if ( this . _repositories . length > 0 && this . visibleRepositories . length === 0 ) {
379379 this . _repositories [ 0 ] . selectionIndex = 0 ;
380380 added = [ this . _repositories [ 0 ] . repository ] ;
381381 }
382382
383- this . _onDidChangeRepositories . fire ( { added, removed : repositoryView . map ( r => r . repository ) } ) ;
383+ this . _onDidChangeRepositories . fire ( { added, removed : removed . map ( r => r . repository ) } ) ;
384384
385- if ( repositoryView . length === 1 && repositoryView [ 0 ] . focused && this . visibleRepositories . length > 0 ) {
385+ // Check if the focused repository was removed
386+ if ( removed . length === 1 && removed [ 0 ] . focused && this . visibleRepositories . length > 0 ) {
386387 this . focus ( this . visibleRepositories [ 0 ] ) ;
387388 }
389+
390+ // Check if the pinned repository was removed
391+ if ( removed . length === 1 && removed [ 0 ] . repository === this . _activeRepositoryPinnedObs . get ( ) ) {
392+ this . _activeRepositoryPinnedObs . set ( undefined , undefined ) ;
393+ }
388394 }
389395
390396 isVisible ( repository : ISCMRepository ) : boolean {
You can’t perform that action at this time.
0 commit comments