File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ const instanceCounter = getScopedCounter();
141141export class Repository implements Disposable {
142142 private _onDidChange = new EventEmitter < RepositoryChangeEvent > ( ) ;
143143 get onDidChange ( ) : Event < RepositoryChangeEvent > {
144+ if ( this . _closed ) {
145+ // Closed repositories generally won't fire change events, so we should check to make sure this is correct
146+ debugger ;
147+ }
144148 return this . _onDidChange . event ;
145149 }
146150
@@ -165,9 +169,7 @@ export class Repository implements Disposable {
165169
166170 private _idHash : string | undefined ;
167171 get idHash ( ) : string {
168- if ( this . _idHash === undefined ) {
169- this . _idHash = md5 ( this . id ) ;
170- }
172+ this . _idHash ??= md5 ( this . id ) ;
171173 return this . _idHash ;
172174 }
173175
@@ -969,8 +971,8 @@ export class Repository implements Disposable {
969971
970972 const disposables : Disposable [ ] = [ ] ;
971973
972- // If the repository is not part of the workspace, then limit watching to only the .gitignore file at the root of the repository
973- const gitIgnorePattern = this . folder != null ? '**/.gitignore' : '.gitignore' ;
974+ // Limit watching to only the .gitignore file at the root of the repository for performance reasons
975+ const gitIgnorePattern = '.gitignore' ;
974976 Logger . debug ( scope , `watching '${ this . uri . toString ( true ) } /${ gitIgnorePattern } ' for .gitignore changes` ) ;
975977
976978 const watcher = workspace . createFileSystemWatcher ( new RelativePattern ( this . uri , gitIgnorePattern ) ) ;
You can’t perform that action at this time.
0 commit comments