@@ -144,60 +144,6 @@ - (IBAction) showTagInfoSheet:(PBRefMenuItem *)sender
144
144
}
145
145
146
146
147
- #pragma mark Remove a branch, remote or tag
148
-
149
- - (IBAction )showDeleteRefSheet : (PBRefMenuItem *)sender
150
- {
151
- id <PBGitRefish> refish = sender.refishs .firstObject ;
152
- if ([refish refishType ] == kGitXCommitType )
153
- return ;
154
-
155
- PBGitRef *ref = (PBGitRef *)refish;
156
-
157
- if ([PBGitDefaults isDialogWarningSuppressedForDialog: kDialogDeleteRef ]) {
158
- NSError *error = nil ;
159
- BOOL success = [historyController.repository deleteRef: ref error: &error];
160
- if (!success) {
161
- [historyController.windowController showErrorSheet: error];
162
- }
163
- return ;
164
- }
165
-
166
- NSString *ref_desc = [NSString stringWithFormat: @" %@ '%@ '" , [ref refishType ], [ref shortName ]];
167
-
168
- NSAlert *alert = [NSAlert alertWithMessageText: [NSString stringWithFormat: @" Delete %@ ?" , ref_desc]
169
- defaultButton: @" Delete"
170
- alternateButton: @" Cancel"
171
- otherButton: nil
172
- informativeTextWithFormat: @" Are you sure you want to remove the %@ ?" , ref_desc];
173
- [alert setShowsSuppressionButton: YES ];
174
-
175
- [alert beginSheetModalForWindow: [historyController.windowController window ]
176
- modalDelegate: self
177
- didEndSelector: @selector (deleteRefSheetDidEnd:returnCode:contextInfo: )
178
- contextInfo: (__bridge_retained void *)ref];
179
- }
180
-
181
- - (void )deleteRefSheetDidEnd : (NSAlert *)sheet returnCode : (int )returnCode contextInfo : (void *)contextInfo
182
- {
183
- [[sheet window ] orderOut: nil ];
184
-
185
- if ([[sheet suppressionButton ] state ] == NSOnState )
186
- [PBGitDefaults suppressDialogWarningForDialog: kDialogDeleteRef ];
187
-
188
- if (returnCode == NSAlertDefaultReturn ) {
189
- PBGitRef *ref = (__bridge PBGitRef *)contextInfo;
190
-
191
- NSError *error = nil ;
192
- BOOL success = [historyController.repository deleteRef: ref error: &error];
193
- if (!success) {
194
- [historyController.windowController showErrorSheet: error];
195
- }
196
- }
197
- }
198
-
199
-
200
-
201
147
#pragma mark Contextual menus
202
148
203
149
- (NSArray <NSMenuItem *> *) menuItemsForRef : (PBGitRef *)ref
0 commit comments