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 @@ -258,12 +258,22 @@ - (void)outlineViewSelectionDidChange:(NSNotification *)notification
258
258
}
259
259
260
260
- (void )doubleClicked : (id )object {
261
- NSInteger rowNumber = [sourceView selectedRow ];
262
- if ([[sourceView itemAtRow: rowNumber] isKindOfClass: [PBGitSVSubmoduleItem class ]]) {
263
- PBGitSVSubmoduleItem *subModule = [sourceView itemAtRow: rowNumber];
264
-
265
- [self openSubmoduleAtURL: [subModule path ]];
266
- }
261
+ NSInteger rowNumber = [sourceView selectedRow ];
262
+
263
+ id item = [sourceView itemAtRow: rowNumber];
264
+ if ([item isKindOfClass: [PBGitSVSubmoduleItem class ]]) {
265
+ PBGitSVSubmoduleItem *subModule = item;
266
+
267
+ [self openSubmoduleAtURL: [subModule path ]];
268
+ } else if ([item isKindOfClass: [PBGitSVBranchItem class ]]) {
269
+ PBGitSVBranchItem *branch = item;
270
+
271
+ NSError *error = nil ;
272
+ BOOL success = [repository checkoutRefish: [branch ref ] error: &error];
273
+ if (!success) {
274
+ [self .windowController showErrorSheet: error];
275
+ }
276
+ }
267
277
}
268
278
269
279
- (BOOL )outlineView : (NSOutlineView *)outlineView shouldEditTableColumn : (NSTableColumn *)tableColumn item : (id )item
You can’t perform that action at this time.
0 commit comments