File tree 1 file changed +4
-12
lines changed
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,6 @@ impl Component for BranchListComponent {
248
248
. map ( Into :: into) ;
249
249
} else if key_match ( e, self . key_config . keys . tab_toggle ) {
250
250
self . local = !self . local ;
251
- self . check_remotes ( ) ;
252
251
self . update_branches ( ) ?;
253
252
} else if key_match ( e, self . key_config . keys . enter ) {
254
253
try_or_popup ! (
@@ -365,23 +364,16 @@ impl BranchListComponent {
365
364
Ok ( ( ) )
366
365
}
367
366
368
- fn check_remotes ( & mut self ) {
369
- if !self . local {
370
- self . has_remotes =
371
- get_branches_info ( & self . repo . borrow ( ) , false )
372
- . map ( |branches| !branches. is_empty ( ) )
373
- . unwrap_or ( false ) ;
374
- }
375
- }
376
-
377
367
/// fetch list of branches
378
368
pub fn update_branches ( & mut self ) -> Result < ( ) > {
379
369
if self . is_visible ( ) {
380
- self . check_remotes ( ) ;
381
370
self . branches =
382
371
get_branches_info ( & self . repo . borrow ( ) , self . local ) ?;
383
- //remove remote branch called `HEAD`
372
+
384
373
if !self . local {
374
+ self . has_remotes = !self . branches . is_empty ( ) ;
375
+
376
+ //remove remote branch called `HEAD`
385
377
self . branches
386
378
. iter ( )
387
379
. position ( |b| b. name . ends_with ( "/HEAD" ) )
You can’t perform that action at this time.
0 commit comments