File tree Expand file tree Collapse file tree 4 files changed +15
-11
lines changed Expand file tree Collapse file tree 4 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -768,7 +768,7 @@ impl App {
768
768
sync:: discard_lines ( CWD , & path, & lines) ?;
769
769
flags. insert ( NeedsUpdate :: ALL ) ;
770
770
}
771
- Action :: DeleteBranch ( branch_ref, true ) => {
771
+ Action :: DeleteLocalBranch ( branch_ref) => {
772
772
if let Err ( e) = sync:: delete_branch ( CWD , & branch_ref)
773
773
{
774
774
self . queue . push ( InternalEvent :: ShowErrorMsg (
@@ -778,8 +778,9 @@ impl App {
778
778
flags. insert ( NeedsUpdate :: ALL ) ;
779
779
self . select_branch_popup . update_branches ( ) ?;
780
780
}
781
- Action :: DeleteBranch ( branch_ref, false ) => {
781
+ Action :: DeleteRemoteBranch ( branch_ref) => {
782
782
self . queue . push (
783
+ //TODO: check if this is correct based on the fix in `c6abbaf`
783
784
branch_ref. rsplit ( '/' ) . next ( ) . map_or_else (
784
785
|| {
785
786
InternalEvent :: ShowErrorMsg ( format ! (
Original file line number Diff line number Diff line change @@ -659,13 +659,15 @@ impl BranchListComponent {
659
659
}
660
660
661
661
fn delete_branch ( & mut self ) {
662
+ let reference =
663
+ self . branches [ self . selection as usize ] . reference . clone ( ) ;
664
+
662
665
self . queue . push ( InternalEvent :: ConfirmAction (
663
- Action :: DeleteBranch (
664
- self . branches [ self . selection as usize ]
665
- . reference
666
- . clone ( ) ,
667
- self . local ,
668
- ) ,
666
+ if self . local {
667
+ Action :: DeleteLocalBranch ( reference)
668
+ } else {
669
+ Action :: DeleteRemoteBranch ( reference)
670
+ } ,
669
671
) ) ;
670
672
}
671
673
}
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ impl ConfirmComponent {
157
157
strings:: confirm_title_reset ( ) ,
158
158
strings:: confirm_msg_reset_lines ( lines. len ( ) ) ,
159
159
) ,
160
- Action :: DeleteBranch ( branch_ref, true ) => (
160
+ Action :: DeleteLocalBranch ( branch_ref) => (
161
161
strings:: confirm_title_delete_branch (
162
162
& self . key_config ,
163
163
) ,
@@ -166,7 +166,7 @@ impl ConfirmComponent {
166
166
branch_ref,
167
167
) ,
168
168
) ,
169
- Action :: DeleteBranch ( branch_ref, false ) => (
169
+ Action :: DeleteRemoteBranch ( branch_ref) => (
170
170
strings:: confirm_title_delete_remote_branch (
171
171
& self . key_config ,
172
172
) ,
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ pub enum Action {
36
36
ResetLines ( String , Vec < DiffLinePosition > ) ,
37
37
StashDrop ( Vec < CommitId > ) ,
38
38
StashPop ( CommitId ) ,
39
- DeleteBranch ( String , bool ) ,
39
+ DeleteLocalBranch ( String ) ,
40
+ DeleteRemoteBranch ( String ) ,
40
41
DeleteTag ( String ) ,
41
42
ForcePush ( String , bool ) ,
42
43
PullMerge { incoming : usize , rebase : bool } ,
You can’t perform that action at this time.
0 commit comments