@@ -115,6 +115,9 @@ impl Component for BranchListComponent {
115115 out. clear ( ) ;
116116 }
117117
118+ let selection_is_cur_branch =
119+ self . selection_is_cur_branch ( ) ;
120+
118121 out. push ( CommandInfo :: new (
119122 strings:: commands:: scroll ( & self . key_config ) ,
120123 true ,
@@ -139,7 +142,7 @@ impl Component for BranchListComponent {
139142 strings:: commands:: compare_with_head (
140143 & self . key_config ,
141144 ) ,
142- !self . selection_is_cur_branch ( ) ,
145+ !selection_is_cur_branch,
143146 true ,
144147 ) ) ;
145148
@@ -156,8 +159,7 @@ impl Component for BranchListComponent {
156159 strings:: commands:: select_branch_popup (
157160 & self . key_config ,
158161 ) ,
159- !self . selection_is_cur_branch ( )
160- && self . valid_selection ( ) ,
162+ !selection_is_cur_branch && self . valid_selection ( ) ,
161163 true ,
162164 ) ) ;
163165
@@ -173,23 +175,23 @@ impl Component for BranchListComponent {
173175 strings:: commands:: delete_branch_popup (
174176 & self . key_config ,
175177 ) ,
176- !self . selection_is_cur_branch ( ) ,
178+ !selection_is_cur_branch,
177179 true ,
178180 ) ) ;
179181
180182 out. push ( CommandInfo :: new (
181183 strings:: commands:: merge_branch_popup (
182184 & self . key_config ,
183185 ) ,
184- !self . selection_is_cur_branch ( ) ,
186+ !selection_is_cur_branch,
185187 true ,
186188 ) ) ;
187189
188190 out. push ( CommandInfo :: new (
189191 strings:: commands:: branch_popup_rebase (
190192 & self . key_config ,
191193 ) ,
192- !self . selection_is_cur_branch ( ) ,
194+ !selection_is_cur_branch,
193195 true ,
194196 ) ) ;
195197
@@ -228,6 +230,9 @@ impl Component for BranchListComponent {
228230 return Ok ( EventState :: Consumed ) ;
229231 }
230232
233+ let selection_is_cur_branch =
234+ self . selection_is_cur_branch ( ) ;
235+
231236 if key_match ( e, self . key_config . keys . enter ) {
232237 try_or_popup ! (
233238 self ,
@@ -243,12 +248,12 @@ impl Component for BranchListComponent {
243248 {
244249 self . rename_branch ( ) ;
245250 } else if key_match ( e, self . key_config . keys . delete_branch )
246- && !self . selection_is_cur_branch ( )
251+ && !selection_is_cur_branch
247252 && self . valid_selection ( )
248253 {
249254 self . delete_branch ( ) ;
250255 } else if key_match ( e, self . key_config . keys . merge_branch )
251- && !self . selection_is_cur_branch ( )
256+ && !selection_is_cur_branch
252257 && self . valid_selection ( )
253258 {
254259 try_or_popup ! (
@@ -257,7 +262,7 @@ impl Component for BranchListComponent {
257262 self . merge_branch( )
258263 ) ;
259264 } else if key_match ( e, self . key_config . keys . rebase_branch )
260- && !self . selection_is_cur_branch ( )
265+ && !selection_is_cur_branch
261266 && self . valid_selection ( )
262267 {
263268 try_or_popup ! (
0 commit comments