@@ -18,7 +18,7 @@ import { binarySearch } from '../../../../base/common/arrays.js';
1818import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js' ;
1919import { IContextKey , IContextKeyService , RawContextKey } from '../../../../platform/contextkey/common/contextkey.js' ;
2020import { IExtensionService } from '../../../services/extensions/common/extensions.js' ;
21- import { derivedObservableWithCache , latestChangedValue , observableFromEventOpts } from '../../../../base/common/observable.js' ;
21+ import { derivedObservableWithCache , derivedOpts , latestChangedValue , observableFromEventOpts } from '../../../../base/common/observable.js' ;
2222import { IEditorService } from '../../../services/editor/common/editorService.js' ;
2323import { EditorResourceAccessor } from '../../../common/editor.js' ;
2424
@@ -186,7 +186,15 @@ export class SCMViewService implements ISCMViewService {
186186 * The focused repository takes precedence over the active editor repository when the observable
187187 * values are updated in the same transaction (or during the initial read of the observable value).
188188 */
189- readonly activeRepository = latestChangedValue ( this , [ this . _activeEditorRepository , this . _focusedRepository ] ) ;
189+ private readonly _activeRepository = latestChangedValue ( this , [ this . _activeEditorRepository , this . _focusedRepository ] ) ;
190+
191+ /**
192+ * Derived with a custom equality function
193+ */
194+ readonly activeRepository = derivedOpts < ISCMRepository | undefined > ( {
195+ owner : this ,
196+ equalsFn : ( r1 , r2 ) => r1 ?. id === r2 ?. id
197+ } , reader => this . _activeRepository . read ( reader ) ) ;
190198
191199 private _repositoriesSortKey : ISCMRepositorySortKey ;
192200 private _sortKeyContextKey : IContextKey < ISCMRepositorySortKey > ;
0 commit comments