File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,9 @@ + (NSArray *) defaultMenuItemsForRef:(PBGitRef *)ref inRepository:(PBGitReposito
47
47
BOOL isDetachedHead = (isHead && [headRefName isEqualToString: @" HEAD" ]);
48
48
49
49
NSString *remoteName = [ref remoteName ];
50
- if (!remoteName && [ref isBranch ])
50
+ if (!remoteName && [ref isBranch ]) {
51
51
remoteName = [[repo remoteRefForBranch: ref error: NULL ] remoteName ];
52
+ }
52
53
BOOL hasRemote = (remoteName ? YES : NO );
53
54
BOOL isRemote = ([ref isRemote ] && ![ref isRemoteBranch ]);
54
55
@@ -131,8 +132,12 @@ + (NSArray *) defaultMenuItemsForRef:(PBGitRef *)ref inRepository:(PBGitReposito
131
132
132
133
// delete ref
133
134
[items addObject: [PBRefMenuItem separatorItem ]];
134
- NSString *deleteTitle = [NSString stringWithFormat: @" Delete %@ …" , targetRefName];
135
- [items addObject: [PBRefMenuItem itemWithTitle: deleteTitle action: @selector (showDeleteRefSheet: ) enabled: !isDetachedHead]];
135
+ {
136
+ NSString *deleteTitle = [NSString stringWithFormat: @" Delete %@ …" , targetRefName];
137
+ BOOL deleteEnabled = !(isDetachedHead || [ref isRemote ]);
138
+ PBRefMenuItem *deleteItem = [PBRefMenuItem itemWithTitle: deleteTitle action: @selector (showDeleteRefSheet: ) enabled: deleteEnabled];
139
+ [items addObject: deleteItem];
140
+ }
136
141
137
142
for (PBRefMenuItem *item in items) {
138
143
[item setTarget: target];
You can’t perform that action at this time.
0 commit comments