Skip to content

Commit 613f231

Browse files
committed
Merge pull request #147 from Kyriakis/master
Bugfix Branch Moving
2 parents ce241c6 + 1d3caf6 commit 613f231

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

PBRefController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
IBOutlet PBCommitList *commitList;
2222

2323
IBOutlet NSPopUpButton *branchPopUp;
24+
NSDictionary *dropInfo;
2425
}
2526

2627
- (void) fetchRemote:(PBRefMenuItem *)sender;

PBRefController.m

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525

2626
@implementation PBRefController
2727

28+
-(void)dealloc
29+
{
30+
[dropInfo release];
31+
32+
[super dealloc];
33+
}
34+
2835
- (void)awakeFromNib
2936
{
3037
[commitList registerForDraggedTypes:[NSArray arrayWithObject:@"PBGitRef"]];
@@ -359,7 +366,7 @@ - (NSDragOperation)tableView:(NSTableView*)tv
359366
return NSDragOperationNone;
360367
}
361368

362-
- (void) dropRef:(NSDictionary *)dropInfo
369+
- (void) dropRef
363370
{
364371
PBGitRef *ref = [dropInfo objectForKey:@"dragRef"];
365372
PBGitCommit *oldCommit = [dropInfo objectForKey:@"oldCommit"];
@@ -401,14 +408,14 @@ - (BOOL)tableView:(NSTableView *)aTableView
401408

402409
PBGitCommit *dropCommit = [[commitController arrangedObjects] objectAtIndex:row];
403410

404-
NSDictionary *dropInfo = [NSDictionary dictionaryWithObjectsAndKeys:
405-
ref, @"dragRef",
406-
oldCommit, @"oldCommit",
407-
dropCommit, @"dropCommit",
408-
nil];
411+
dropInfo = [NSDictionary dictionaryWithObjectsAndKeys:
412+
ref, @"dragRef",
413+
oldCommit, @"oldCommit",
414+
dropCommit, @"dropCommit",
415+
nil];
409416

410417
if ([PBGitDefaults isDialogWarningSuppressedForDialog:kDialogAcceptDroppedRef]) {
411-
[self dropRef:dropInfo];
418+
[self dropRef];
412419
return YES;
413420
}
414421

@@ -427,7 +434,7 @@ - (BOOL)tableView:(NSTableView *)aTableView
427434
[alert beginSheetModalForWindow:[historyController.repository.windowController window]
428435
modalDelegate:self
429436
didEndSelector:@selector(acceptDropInfoAlertDidEnd:returnCode:contextInfo:)
430-
contextInfo:dropInfo];
437+
contextInfo:Nil];
431438

432439
return YES;
433440
}
@@ -437,7 +444,7 @@ - (void)acceptDropInfoAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnC
437444
[[alert window] orderOut:nil];
438445

439446
if (returnCode == NSAlertDefaultReturn)
440-
[self dropRef:contextInfo];
447+
[self dropRef];
441448

442449
if ([[alert suppressionButton] state] == NSOnState)
443450
[PBGitDefaults suppressDialogWarningForDialog:kDialogAcceptDroppedRef];

0 commit comments

Comments
 (0)