@@ -8,7 +8,7 @@ import * as path from 'path';
8
8
import { Repository , GitResourceGroup } from './repository' ;
9
9
import { Model } from './model' ;
10
10
import { debounce } from './decorators' ;
11
- import { filterEvent , dispose , anyEvent , fireEvent , PromiseSource , combinedDisposable } from './util' ;
11
+ import { filterEvent , dispose , anyEvent , fireEvent , PromiseSource , combinedDisposable , runAndSubscribeEvent } from './util' ;
12
12
import { Change , GitErrorCodes , Status } from './api/git' ;
13
13
14
14
class GitIgnoreDecorationProvider implements FileDecorationProvider {
@@ -101,7 +101,7 @@ class GitDecorationProvider implements FileDecorationProvider {
101
101
constructor ( private repository : Repository ) {
102
102
this . disposables . push (
103
103
window . registerFileDecorationProvider ( this ) ,
104
- repository . onDidRunGitStatus ( this . onDidRunGitStatus , this )
104
+ runAndSubscribeEvent ( repository . onDidRunGitStatus , ( ) => this . onDidRunGitStatus ( ) )
105
105
) ;
106
106
}
107
107
@@ -162,8 +162,10 @@ class GitIncomingChangesFileDecorationProvider implements FileDecorationProvider
162
162
private readonly disposables : Disposable [ ] = [ ] ;
163
163
164
164
constructor ( private readonly repository : Repository ) {
165
- this . disposables . push ( window . registerFileDecorationProvider ( this ) ) ;
166
- repository . historyProvider . onDidChangeCurrentHistoryItemGroup ( this . onDidChangeCurrentHistoryItemGroup , this , this . disposables ) ;
165
+ this . disposables . push (
166
+ window . registerFileDecorationProvider ( this ) ,
167
+ runAndSubscribeEvent ( repository . historyProvider . onDidChangeCurrentHistoryItemGroup , ( ) => this . onDidChangeCurrentHistoryItemGroup ( ) )
168
+ ) ;
167
169
}
168
170
169
171
private async onDidChangeCurrentHistoryItemGroup ( ) : Promise < void > {
0 commit comments