mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Add Diff to contextual menus
- added to menus for refs, commits, and files
- show a message when there are no changes
This commit is contained in:
@@ -66,6 +66,10 @@
|
||||
// view tag info
|
||||
if ([ref isTag])
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"View tag info…" action:@selector(showTagInfoSheet:) enabled:YES]];
|
||||
|
||||
// Diff
|
||||
NSString *diffTitle = [NSString stringWithFormat:@"Diff with %@", headRefName];
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:diffTitle action:@selector(diffWithHEAD:) enabled:!isHead]];
|
||||
[items addObject:[PBRefMenuItem separatorItem]];
|
||||
|
||||
// merge ref
|
||||
@@ -141,6 +145,7 @@
|
||||
|
||||
NSString *headBranchName = [[[commit.repository headRef] ref] shortName];
|
||||
BOOL isOnHeadBranch = [commit isOnHeadBranch];
|
||||
BOOL isHead = [[commit realSha] isEqualToString:[commit.repository headSHA]];
|
||||
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"Checkout Commit" action:@selector(checkout:) enabled:YES]];
|
||||
[items addObject:[PBRefMenuItem separatorItem]];
|
||||
@@ -151,6 +156,8 @@
|
||||
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"Copy SHA" action:@selector(copySHA:) enabled:YES]];
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:@"Copy Patch" action:@selector(copyPatch:) enabled:YES]];
|
||||
NSString *diffTitle = [NSString stringWithFormat:@"Diff with %@", headBranchName];
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:diffTitle action:@selector(diffWithHEAD:) enabled:!isHead]];
|
||||
[items addObject:[PBRefMenuItem separatorItem]];
|
||||
|
||||
// merge commit
|
||||
|
||||
Reference in New Issue
Block a user