mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Add a menu item and an action for pushing a repo up.
This commit is contained in:
committed by
André Berg
parent
fa929eb7c9
commit
cdc4f5208b
+15
-1
@@ -60,7 +60,21 @@
|
||||
int ret = 1;
|
||||
[historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"checkout", [[sender ref] shortName], nil] retValue: &ret];
|
||||
if (ret) {
|
||||
[[historyController.repository windowController] showMessageSheet:@"Checking out branch failed" infoText:@"There was an error checking out the branch. Perhaps your working directory is not clean?"];
|
||||
NSString *info = [NSString stringWithFormat:@"There was an error checking out the branch. Perhaps your working directory is not clean?"];
|
||||
[[historyController.repository windowController] showMessageSheet:@"Checking out branch failed" infoText:info];
|
||||
return;
|
||||
}
|
||||
[historyController.repository reloadRefs];
|
||||
[commitController rearrangeObjects];
|
||||
}
|
||||
|
||||
- (void) pushRef:(PBRefMenuItem *)sender
|
||||
{
|
||||
int ret = 1;
|
||||
NSString *rval = [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"push", @"origin", [[sender ref] shortName], nil] retValue: &ret];
|
||||
if (ret) {
|
||||
NSString *info = [NSString stringWithFormat:@"There was an error pushing the branch to the origin.\n\n%d\n%@", ret, rval];
|
||||
[[historyController.repository windowController] showMessageSheet:@"Pushing branch failed" infoText:info];
|
||||
return;
|
||||
}
|
||||
[historyController.repository reloadRefs];
|
||||
|
||||
+6
-1
@@ -28,7 +28,12 @@
|
||||
[array addObject:[[PBRefMenuItem alloc] initWithTitle:@"Checkout branch"
|
||||
action:@selector(checkoutRef:)
|
||||
keyEquivalent: @""]];
|
||||
|
||||
|
||||
if ([type isEqualToString:@"branch"])
|
||||
[array addObject:[[PBRefMenuItem alloc] initWithTitle:@"Push branch"
|
||||
action:@selector(pushRef:)
|
||||
keyEquivalent: @""]];
|
||||
|
||||
if ([type isEqualToString:@"tag"])
|
||||
[array addObject:[[PBRefMenuItem alloc] initWithTitle:@"View tag info"
|
||||
action:@selector(tagInfo:)
|
||||
|
||||
Reference in New Issue
Block a user