@@ -6,11 +6,12 @@ use crate::{
6
6
BranchListComponent , CommandBlocking , CommandInfo ,
7
7
CommitComponent , CompareCommitsComponent , Component ,
8
8
ConfirmComponent , CreateBranchComponent , DrawableComponent ,
9
- ExternalEditorComponent , FileFindPopup , HelpComponent ,
10
- InspectCommitComponent , MsgComponent , OptionsPopupComponent ,
11
- PullComponent , PushComponent , PushTagsComponent ,
12
- RenameBranchComponent , RevisionFilesPopup , SharedOptions ,
13
- StashMsgComponent , TagCommitComponent , TagListComponent ,
9
+ ExternalEditorComponent , FetchComponent , FileFindPopup ,
10
+ HelpComponent , InspectCommitComponent , MsgComponent ,
11
+ OptionsPopupComponent , PullComponent , PushComponent ,
12
+ PushTagsComponent , RenameBranchComponent , RevisionFilesPopup ,
13
+ SharedOptions , StashMsgComponent , TagCommitComponent ,
14
+ TagListComponent ,
14
15
} ,
15
16
input:: { Input , InputEvent , InputState } ,
16
17
keys:: { KeyConfig , SharedKeyConfig } ,
@@ -55,6 +56,7 @@ pub struct App {
55
56
push_popup : PushComponent ,
56
57
push_tags_popup : PushTagsComponent ,
57
58
pull_popup : PullComponent ,
59
+ fetch_popup : FetchComponent ,
58
60
tag_commit_popup : TagCommitComponent ,
59
61
create_branch_popup : CreateBranchComponent ,
60
62
rename_branch_popup : RenameBranchComponent ,
@@ -158,6 +160,12 @@ impl App {
158
160
theme. clone ( ) ,
159
161
key_config. clone ( ) ,
160
162
) ,
163
+ fetch_popup : FetchComponent :: new (
164
+ & queue,
165
+ sender,
166
+ theme. clone ( ) ,
167
+ key_config. clone ( ) ,
168
+ ) ,
161
169
tag_commit_popup : TagCommitComponent :: new (
162
170
queue. clone ( ) ,
163
171
theme. clone ( ) ,
@@ -389,6 +397,7 @@ impl App {
389
397
self . push_popup . update_git ( ev) ?;
390
398
self . push_tags_popup . update_git ( ev) ?;
391
399
self . pull_popup . update_git ( ev) ;
400
+ self . fetch_popup . update_git ( ev) ;
392
401
self . select_branch_popup . update_git ( ev) ?;
393
402
}
394
403
@@ -421,6 +430,7 @@ impl App {
421
430
|| self . push_popup . any_work_pending ( )
422
431
|| self . push_tags_popup . any_work_pending ( )
423
432
|| self . pull_popup . any_work_pending ( )
433
+ || self . fetch_popup . any_work_pending ( )
424
434
|| self . revision_files_popup . any_work_pending ( )
425
435
|| self . tags_popup . any_work_pending ( )
426
436
}
@@ -453,6 +463,7 @@ impl App {
453
463
push_popup,
454
464
push_tags_popup,
455
465
pull_popup,
466
+ fetch_popup,
456
467
tag_commit_popup,
457
468
create_branch_popup,
458
469
rename_branch_popup,
@@ -489,6 +500,7 @@ impl App {
489
500
push_popup,
490
501
push_tags_popup,
491
502
pull_popup,
503
+ fetch_popup,
492
504
options_popup,
493
505
reset,
494
506
msg
@@ -696,6 +708,14 @@ impl App {
696
708
}
697
709
flags. insert ( NeedsUpdate :: ALL ) ;
698
710
}
711
+ InternalEvent :: FetchRemotes => {
712
+ if let Err ( error) = self . fetch_popup . fetch ( ) {
713
+ self . queue . push ( InternalEvent :: ShowErrorMsg (
714
+ error. to_string ( ) ,
715
+ ) ) ;
716
+ }
717
+ flags. insert ( NeedsUpdate :: ALL ) ;
718
+ }
699
719
InternalEvent :: PushTags => {
700
720
self . push_tags_popup . push_tags ( ) ?;
701
721
flags. insert ( NeedsUpdate :: ALL ) ;
0 commit comments