Skip to content

Commit a43a1ef

Browse files
committed
Assert that we're selecting refs on the main thread
1 parent 9a43117 commit a43a1ef

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Classes/Controllers/PBGitSidebarController.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,16 @@ - (void) selectCurrentBranch
170170
return;
171171
}
172172

173-
dispatch_async(dispatch_get_main_queue(), ^{
174-
PBSourceViewItem *item = [self addRevSpec:rev];
175-
if (item) {
176-
[sourceView PBExpandItem:item expandParents:YES];
177-
NSIndexSet *index = [NSIndexSet indexSetWithIndex:[sourceView rowForItem:item]];
178-
179-
[sourceView deselectAll:nil];
180-
[sourceView selectRowIndexes:index byExtendingSelection:NO];
181-
}
182-
});
173+
dispatch_assert_queue(dispatch_get_main_queue());
174+
175+
PBSourceViewItem *item = [self addRevSpec:rev];
176+
if (item) {
177+
[sourceView PBExpandItem:item expandParents:YES];
178+
NSIndexSet *index = [NSIndexSet indexSetWithIndex:[sourceView rowForItem:item]];
179+
180+
[sourceView deselectAll:nil];
181+
[sourceView selectRowIndexes:index byExtendingSelection:NO];
182+
}
183183
}
184184

185185
- (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev

0 commit comments

Comments
 (0)