Skip to content

Commit 17e939e

Browse files
committed
Avoid retaining history in publication regression test
gitx/gitx#184 gitx/gitx#131
1 parent 687a6cc commit 17e939e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎GitXTests/GitXCoreTests.m‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,12 @@ - (void)testRapidHistoryRefreshKeepsAUniqueNonemptySnapshot
505505
PBGitHistoryList *history = self.repository.revisionList;
506506
XCTAssertEqual(history.commits.count, expectedCount);
507507
NSMutableArray<NSNumber *> *publishedCounts = [NSMutableArray array];
508+
__weak PBGitHistoryList *weakHistory = history;
508509
id<MAKVOObservation> observation = [history addObserver:self
509510
keyPath:@"commits"
510511
options:0
511512
block:^(__unused MAKVONotification *notification) {
512-
[publishedCounts addObject:@(history.commits.count)];
513+
[publishedCounts addObject:@(weakHistory.commits.count)];
513514
}];
514515

515516
[self.repository forceUpdateRevisions];

0 commit comments

Comments
 (0)