@@ -67,6 +67,8 @@ - (void)awakeFromNib
67
67
window.contentView = self.view ;
68
68
[self populateList ];
69
69
70
+ PBGitRepository *repository = self.repository ;
71
+
70
72
[repository addObserver: self
71
73
keyPath: @" currentBranch"
72
74
options: 0
@@ -125,11 +127,6 @@ - (void)awakeFromNib
125
127
[[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (expandCollapseItem: ) name: NSOutlineViewItemWillCollapseNotification object: sourceView];
126
128
}
127
129
128
- - (void )closeView
129
- {
130
- [super closeView ];
131
- }
132
-
133
130
- (void )dealloc
134
131
{
135
132
[[NSNotificationCenter defaultCenter ] removeObserver: self name: NSOutlineViewItemWillExpandNotification object: sourceView];
@@ -152,6 +149,7 @@ - (void)selectStage
152
149
153
150
- (void )selectCurrentBranch
154
151
{
152
+ PBGitRepository *repository = self.repository ;
155
153
PBGitRevSpecifier *rev = repository.currentBranch ;
156
154
if (!rev) {
157
155
[repository reloadRefs ];
@@ -239,18 +237,19 @@ - (void)outlineViewSelectionDidChange:(NSNotification *)notification
239
237
{
240
238
NSInteger index = [sourceView selectedRow ];
241
239
PBSourceViewItem *item = [sourceView itemAtRow: index ];
240
+ PBGitWindowController *windowController = self.windowController ;
242
241
243
242
if ([item revSpecifier ]) {
244
- if (![repository.currentBranch isEqual: [item revSpecifier ]]) {
245
- repository.currentBranch = [item revSpecifier ];
243
+ if (![self . repository.currentBranch isEqual: [item revSpecifier ]]) {
244
+ self. repository .currentBranch = [item revSpecifier ];
246
245
}
247
246
248
- [superController changeContentController: superController .historyViewController];
247
+ [windowController changeContentController: windowController .historyViewController];
249
248
[PBGitDefaults setShowStageView: NO ];
250
249
}
251
250
252
251
if (item == stage) {
253
- [superController changeContentController: superController .commitViewController];
252
+ [windowController changeContentController: windowController .commitViewController];
254
253
[PBGitDefaults setShowStageView: YES ];
255
254
}
256
255
@@ -271,7 +270,7 @@ - (void)doubleClicked:(id)object
271
270
PBSourceViewGitBranchItem *branch = item;
272
271
273
272
NSError *error = nil ;
274
- BOOL success = [repository checkoutRefish: [branch ref ] error: &error];
273
+ BOOL success = [self . repository checkoutRefish: [branch ref ] error: &error];
275
274
if (!success) {
276
275
[self .windowController showErrorSheet: error];
277
276
}
@@ -297,7 +296,7 @@ - (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTable
297
296
298
297
cell.textField .stringValue = [[item title ] copy ];
299
298
cell.imageView .image = item.icon ;
300
- cell.isCheckedOut = [item.revSpecifier isEqual: [repository headRef ]];
299
+ cell.isCheckedOut = [item.revSpecifier isEqual: [self . repository headRef ]];
301
300
302
301
return cell;
303
302
}
@@ -329,6 +328,7 @@ - (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowOutlineCellForItem:(i
329
328
330
329
- (void )populateList
331
330
{
331
+ PBGitRepository *repository = self.repository ;
332
332
PBSourceViewItem *project = [PBSourceViewItem groupItemWithTitle: [repository projectName ]];
333
333
project.uncollapsible = YES ;
334
334
@@ -420,7 +420,7 @@ - (void)addMenuItemsForRef:(PBGitRef *)ref toMenu:(NSMenu *)menu
420
420
if (!ref)
421
421
return ;
422
422
423
- for (NSMenuItem *menuItem in [superController .historyViewController menuItemsForRef: ref])
423
+ for (NSMenuItem *menuItem in [self .windowController .historyViewController menuItemsForRef: ref])
424
424
[menu addItem: menuItem];
425
425
}
426
426
@@ -493,7 +493,7 @@ - (void)updateRemoteControls
493
493
BOOL hasRemote = NO ;
494
494
495
495
PBGitRef *ref = [[self selectedItem ] ref ];
496
- if ([ref isRemote ] || ([ref isBranch ] && [[repository remoteRefForBranch: ref error: NULL ] remoteName ]))
496
+ if ([ref isRemote ] || ([ref isBranch ] && [[self . repository remoteRefForBranch: ref error: NULL ] remoteName ]))
497
497
hasRemote = YES ;
498
498
499
499
[remoteControls setEnabled: hasRemote forSegment: kFetchSegment ];
@@ -520,7 +520,7 @@ - (IBAction)fetchPullPushAction:(id)sender
520
520
if (![ref isRemote ] && ![ref isBranch ])
521
521
return ;
522
522
523
- PBGitRef *remoteRef = [repository remoteRefForBranch: ref error: NULL ];
523
+ PBGitRef *remoteRef = [self . repository remoteRefForBranch: ref error: NULL ];
524
524
if (!remoteRef)
525
525
return ;
526
526
0 commit comments