diff --git a/PBRefController.m b/PBRefController.m index 58f65dc..62a9d57 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -131,7 +131,8 @@ [self showMessageSheet:@"Pull from Remote" message:PBMissingRemoteErrorMessage]; return success; } - NSString *rval = [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"pull", remote, refName, nil] retValue: &ret]; + NSArray * args = [NSArray arrayWithObjects:@"pull", remote, refName, nil]; + NSString *rval = [historyController.repository outputInWorkdirForArguments:args retValue: &ret]; if (ret) { NSString *info = [NSString stringWithFormat:@"There was an error pulling from the remote repository.\n\n%d\n%@", ret, rval]; [[historyController.repository windowController] showMessageSheet:@"Pulling from remote failed" infoText:info]; @@ -149,7 +150,7 @@ BOOL success = NO; NSString *remote = [[[historyController repository] config] valueForKeyPath:[NSString stringWithFormat:@"branch.%@.remote", refName]]; if (!remote) { - [self showMessageSheet:@"Pull Rebase from Remote" message:PBMissingRemoteErrorMessage]; + [self showMessageSheet:@"Pull from Remote and Rebase" message:PBMissingRemoteErrorMessage]; return success; } NSString *rval = [[historyController repository] outputInWorkdirForArguments:[NSArray arrayWithObjects:@"pull", @"--rebase", remote, refName, nil] retValue: &ret]; @@ -283,6 +284,8 @@ } # pragma mark Add ref methods + + -(void)addRef:(id)sender { [errorMessage setStringValue:@""]; @@ -293,21 +296,7 @@ contextInfo:NULL]; } -- (void) showMessageSheet:(NSString *)title message:(NSString *)msg { - - [[NSAlert alertWithMessageText:title - defaultButton:@"OK" - alternateButton:nil - otherButton:nil - informativeTextWithFormat:msg] - beginSheetModalForWindow:[[historyController view] window] - modalDelegate:self - didEndSelector:nil - contextInfo:nil]; - - return; -} - +// MARK: Buttons -(void)rebaseButton:(id)sender { NSString *refName = [[[[historyController repository] currentBranch] simpleRef] refForSpec]; @@ -354,6 +343,23 @@ // NSLog([NSString stringWithFormat:@"Fetch hit for %@!", refName]); } +// MARK: Sheets + +- (void) showMessageSheet:(NSString *)title message:(NSString *)msg { + + [[NSAlert alertWithMessageText:title + defaultButton:@"OK" + alternateButton:nil + otherButton:nil + informativeTextWithFormat:msg] + beginSheetModalForWindow:[[historyController view] window] + modalDelegate:self + didEndSelector:nil + contextInfo:nil]; + + return; +} + -(void)saveSheet:(id) sender { NSString *branchName = [@"refs/heads/" stringByAppendingString:[newBranchName stringValue]];