@@ -70,10 +70,10 @@ - (void)windowWillClose:(NSNotification *)notification
70
70
- (BOOL )validateMenuItem : (NSMenuItem *)menuItem
71
71
{
72
72
if ([menuItem action ] == @selector (showCommitView: )) {
73
- [menuItem setState: (contentController == sidebarController.commitViewController ) ? YES : NO ];
73
+ [menuItem setState: (contentController == _commitViewController ) ? YES : NO ];
74
74
return ![self .repository isBareRepository ];
75
75
} else if ([menuItem action ] == @selector (showHistoryView: )) {
76
- [menuItem setState: (contentController != sidebarController.commitViewController ) ? YES : NO ];
76
+ [menuItem setState: (contentController != _commitViewController ) ? YES : NO ];
77
77
return ![self .repository isBareRepository ];
78
78
} else if (menuItem.action == @selector (fetchRemote: )) {
79
79
return [self validateMenuItem: menuItem remoteTitle: @" Fetch “%@ ”" plainTitle: @" Fetch" ];
@@ -117,6 +117,8 @@ - (void) windowDidLoad
117
117
[[self window ] setRepresentedURL: self .repository.workingDirectoryURL];
118
118
119
119
sidebarController = [[PBGitSidebarController alloc ] initWithRepository: self .repository superController: self ];
120
+ _historyViewController = [[PBGitHistoryController alloc ] initWithRepository: self .repository superController: self ];
121
+ _commitViewController = [[PBGitCommitController alloc ] initWithRepository: self .repository superController: self ];
120
122
121
123
[[sidebarController view ] setFrame: [sourceSplitView bounds ]];
122
124
[sourceSplitView addSubview: [sidebarController view ]];
@@ -172,7 +174,7 @@ - (void)showCommitHookFailedSheet:(NSString *)messageText infoText:(NSString *)i
172
174
completionHandler: ^(id _Nonnull sheet, NSModalResponse returnCode) {
173
175
if (returnCode != NSModalResponseOK ) return ;
174
176
175
- [sidebarController.commitViewController forceCommit: self ];
177
+ [_commitViewController forceCommit: self ];
176
178
}];
177
179
}
178
180
@@ -424,7 +426,7 @@ - (void)performPushForBranch:(PBGitRef *)branchRef toRemote:(PBGitRef *)remoteRe
424
426
if ([types indexOfObject: kGitXCommitType ] == NSNotFound )
425
427
return nil ;
426
428
427
- return sidebarController. historyViewController .selectedCommits .firstObject ;
429
+ return _historyViewController .selectedCommits .firstObject ;
428
430
}
429
431
430
432
- (PBSourceViewItem *) selectedItem {
@@ -733,7 +735,7 @@ - (void) createBranch:(id)sender
733
735
/* WIP: must check */
734
736
id <PBGitRefish> refish = [self refishForSender: sender refishTypes: nil ];
735
737
if (!refish) {
736
- PBGitCommit *selectedCommit = sidebarController. historyViewController .selectedCommits .firstObject ;
738
+ PBGitCommit *selectedCommit = _historyViewController .selectedCommits .firstObject ;
737
739
if (!selectedCommit || [selectedCommit hasRef: currentRef]) {
738
740
refish = currentRef;
739
741
} else {
@@ -768,7 +770,7 @@ - (IBAction) createTag:(id)sender
768
770
/* WIP: must check */
769
771
id <PBGitRefish> refish = [self refishForSender: sender refishTypes: nil ];
770
772
if (!refish) {
771
- PBGitCommit *selectedCommit = sidebarController. historyViewController .selectedCommits .firstObject ;
773
+ PBGitCommit *selectedCommit = _historyViewController .selectedCommits .firstObject ;
772
774
if (selectedCommit)
773
775
refish = selectedCommit;
774
776
else
0 commit comments