diff --git a/src/repository.ts b/src/repository.ts index cfdeb68e0..778c98517 100644 --- a/src/repository.ts +++ b/src/repository.ts @@ -188,12 +188,9 @@ export class Repository implements IRemoteRepository { this.disposables.push(this._fsWatcher); this._fsWatcher.onDidAny(this.onFSChange, this, this.disposables); - - // TODO on svn switch event fired two times since two files were changed this._fsWatcher.onDidSvnAny( async (e: Uri) => { - await this.repository.updateInfo(); - this._onDidChangeRepository.fire(e); + await this.onDidAnyFileChanged(e); }, this, this.disposables @@ -292,6 +289,12 @@ export class Repository implements IRemoteRepository { ); } + @debounce(1000) + private async onDidAnyFileChanged(e: Uri) { + await this.repository.updateInfo(); + this._onDidChangeRepository.fire(e); + } + private createRemoteChangedInterval() { const updateFreq = configuration.get( "remoteChanges.checkFrequency",