@@ -18,7 +18,7 @@ import { binarySearch } from '../../../../base/common/arrays.js';
18
18
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js' ;
19
19
import { IContextKey , IContextKeyService , RawContextKey } from '../../../../platform/contextkey/common/contextkey.js' ;
20
20
import { 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' ;
22
22
import { IEditorService } from '../../../services/editor/common/editorService.js' ;
23
23
import { EditorResourceAccessor } from '../../../common/editor.js' ;
24
24
@@ -186,7 +186,15 @@ export class SCMViewService implements ISCMViewService {
186
186
* The focused repository takes precedence over the active editor repository when the observable
187
187
* values are updated in the same transaction (or during the initial read of the observable value).
188
188
*/
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 ) ) ;
190
198
191
199
private _repositoriesSortKey : ISCMRepositorySortKey ;
192
200
private _sortKeyContextKey : IContextKey < ISCMRepositorySortKey > ;
0 commit comments