Disable the Checkout menu item when the branch is the current branch.

This commit is contained in:
brotherbard
2009-11-07 22:31:14 -07:00
parent 2b459944a2
commit 0377181bbf
+9 -6
View File
@@ -44,12 +44,15 @@
[array addObject:[self addRemoteMethod:hasRemote title:[NSString stringWithFormat:@"Push %@ to remote", targetRef] action:@selector(pushRef:)]];
[array addObject:[self addRemoteMethod:hasRemote title:[NSString stringWithFormat:@"Pull down latest"] action:@selector(pullRef:)]];
[array addObject:[self addRemoteMethod:hasRemote title:[NSString stringWithFormat:@"Rebase local changes with latest"] action:@selector(rebaseRef:)]];
}
if ([type isEqualToString:@"branch"])
[array addObject:[[PBRefMenuItem alloc] initWithTitle:[@"Checkout " stringByAppendingString:targetRef]
action:@selector(checkoutRef:)
keyEquivalent: @""]];
PBRefMenuItem *item = [[PBRefMenuItem alloc] initWithTitle:[@"Checkout " stringByAppendingString:targetRef]
action:@selector(checkoutRef:)
keyEquivalent: @""];
if ([targetRef isEqualToString:[[commit repository] currentBranch].description])
[item setEnabled:NO];
[array addObject:item];
}
[array addObject:[[PBRefMenuItem alloc] initWithTitle:[@"Delete " stringByAppendingString:targetRef]
action:@selector(removeRef:)