File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -245,12 +245,22 @@ - (void)outlineViewSelectionDidChange:(NSNotification *)notification
245
245
}
246
246
247
247
- (void )doubleClicked : (id )object {
248
- NSInteger rowNumber = [sourceView selectedRow ];
249
- if ([[sourceView itemAtRow: rowNumber] isKindOfClass: [PBGitSVSubmoduleItem class ]]) {
250
- PBGitSVSubmoduleItem *subModule = [sourceView itemAtRow: rowNumber];
251
-
252
- [self openSubmoduleAtURL: [subModule path ]];
253
- }
248
+ NSInteger rowNumber = [sourceView selectedRow ];
249
+
250
+ id item = [sourceView itemAtRow: rowNumber];
251
+ if ([item isKindOfClass: [PBGitSVSubmoduleItem class ]]) {
252
+ PBGitSVSubmoduleItem *subModule = item;
253
+
254
+ [self openSubmoduleAtURL: [subModule path ]];
255
+ } else if ([item isKindOfClass: [PBGitSVBranchItem class ]]) {
256
+ PBGitSVBranchItem *branch = item;
257
+
258
+ NSError *error = nil ;
259
+ BOOL success = [repository checkoutRefish: [branch ref ] error: &error];
260
+ if (!success) {
261
+ [self .windowController showErrorSheet: error];
262
+ }
263
+ }
254
264
}
255
265
256
266
- (BOOL )outlineView : (NSOutlineView *)outlineView shouldEditTableColumn : (NSTableColumn *)tableColumn item : (id )item
You can’t perform that action at this time.
0 commit comments