File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/vs/sessions/contrib/gitSync/browser Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,17 @@ class GitSyncContribution extends Disposable implements IWorkbenchContribution {
4848 return ;
4949 }
5050
51+ const repoDisposables = this . _gitRepoDisposables . add ( new DisposableStore ( ) ) ;
5152 this . gitService . openRepository ( worktreeUri ) . then ( repository => {
53+ if ( repoDisposables . isDisposed ) {
54+ return ;
55+ }
5256 if ( ! repository ) {
5357 this . _syncActionDisposable . clear ( ) ;
5458 contextKey . set ( false ) ;
5559 return ;
5660 }
57- this . _gitRepoDisposables . add ( autorun ( innerReader => {
61+ repoDisposables . add ( autorun ( innerReader => {
5862 const state = repository . state . read ( innerReader ) ;
5963 const head = state . HEAD ;
6064 if ( ! head ?. upstream ) {
@@ -66,7 +70,7 @@ class GitSyncContribution extends Disposable implements IWorkbenchContribution {
6670 const behind = head . behind ?? 0 ;
6771 const hasSyncChanges = ahead > 0 || behind > 0 ;
6872 contextKey . set ( hasSyncChanges ) ;
69- this . _syncActionDisposable . value = registerSyncAction ( ahead , behind ) ;
73+ this . _syncActionDisposable . value = registerSyncAction ( behind , ahead ) ;
7074 } ) ) ;
7175 } ) ;
7276 } ) ) ;
You can’t perform that action at this time.
0 commit comments