@@ -6,11 +6,12 @@ use crate::{
66 BranchListComponent , CommandBlocking , CommandInfo ,
77 CommitComponent , CompareCommitsComponent , Component ,
88 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 ,
1415 } ,
1516 input:: { Input , InputEvent , InputState } ,
1617 keys:: { KeyConfig , SharedKeyConfig } ,
@@ -55,6 +56,7 @@ pub struct App {
5556 push_popup : PushComponent ,
5657 push_tags_popup : PushTagsComponent ,
5758 pull_popup : PullComponent ,
59+ fetch_popup : FetchComponent ,
5860 tag_commit_popup : TagCommitComponent ,
5961 create_branch_popup : CreateBranchComponent ,
6062 rename_branch_popup : RenameBranchComponent ,
@@ -158,6 +160,12 @@ impl App {
158160 theme. clone ( ) ,
159161 key_config. clone ( ) ,
160162 ) ,
163+ fetch_popup : FetchComponent :: new (
164+ & queue,
165+ sender,
166+ theme. clone ( ) ,
167+ key_config. clone ( ) ,
168+ ) ,
161169 tag_commit_popup : TagCommitComponent :: new (
162170 queue. clone ( ) ,
163171 theme. clone ( ) ,
@@ -389,6 +397,7 @@ impl App {
389397 self . push_popup . update_git ( ev) ?;
390398 self . push_tags_popup . update_git ( ev) ?;
391399 self . pull_popup . update_git ( ev) ;
400+ self . fetch_popup . update_git ( ev) ;
392401 self . select_branch_popup . update_git ( ev) ?;
393402 }
394403
@@ -421,6 +430,7 @@ impl App {
421430 || self . push_popup . any_work_pending ( )
422431 || self . push_tags_popup . any_work_pending ( )
423432 || self . pull_popup . any_work_pending ( )
433+ || self . fetch_popup . any_work_pending ( )
424434 || self . revision_files_popup . any_work_pending ( )
425435 || self . tags_popup . any_work_pending ( )
426436 }
@@ -453,6 +463,7 @@ impl App {
453463 push_popup,
454464 push_tags_popup,
455465 pull_popup,
466+ fetch_popup,
456467 tag_commit_popup,
457468 create_branch_popup,
458469 rename_branch_popup,
@@ -489,6 +500,7 @@ impl App {
489500 push_popup,
490501 push_tags_popup,
491502 pull_popup,
503+ fetch_popup,
492504 options_popup,
493505 reset,
494506 msg
@@ -696,6 +708,14 @@ impl App {
696708 }
697709 flags. insert ( NeedsUpdate :: ALL ) ;
698710 }
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+ }
699719 InternalEvent :: PushTags => {
700720 self . push_tags_popup . push_tags ( ) ?;
701721 flags. insert ( NeedsUpdate :: ALL ) ;
0 commit comments