File tree Expand file tree Collapse file tree 2 files changed +31
-11
lines changed Expand file tree Collapse file tree 2 files changed +31
-11
lines changed Original file line number Diff line number Diff line change @@ -90,13 +90,8 @@ impl AsyncFetch {
90
90
arc_progress,
91
91
) ;
92
92
93
- fetch_all (
94
- CWD ,
95
- "origin" ,
96
- params. basic_credential . clone ( ) ,
97
- Some ( progress_sender. clone ( ) ) ,
98
- )
99
- . expect ( "" ) ;
93
+ fetch_all ( CWD , params. basic_credential . clone ( ) )
94
+ . expect ( "" ) ;
100
95
101
96
let res = fetch (
102
97
CWD ,
Original file line number Diff line number Diff line change @@ -76,14 +76,12 @@ pub(crate) fn get_default_remote_in_repo(
76
76
}
77
77
78
78
///
79
- pub fn fetch_all (
79
+ fn fetch_from_remote (
80
80
repo_path : & str ,
81
81
remote : & str ,
82
82
basic_credential : Option < BasicAuthCredential > ,
83
83
progress_sender : Option < Sender < ProgressNotification > > ,
84
84
) -> Result < ( ) > {
85
- scope_time ! ( "fetch_all" ) ;
86
-
87
85
let repo = utils:: repo ( repo_path) ?;
88
86
89
87
let mut remote = repo. find_remote ( remote) ?;
@@ -97,7 +95,34 @@ pub fn fetch_all(
97
95
Ok ( ( ) )
98
96
}
99
97
100
- /// fetches from upstream/remote for `branch`
98
+ /// updates/prunes all branches from all remotes
99
+ pub fn fetch_all (
100
+ repo_path : & str ,
101
+ basic_credential : Option < BasicAuthCredential > ,
102
+ ) -> Result < ( ) > {
103
+ scope_time ! ( "fetch_all" ) ;
104
+
105
+ let repo = utils:: repo ( repo_path) ?;
106
+ let remotes = repo
107
+ . remotes ( ) ?
108
+ . iter ( )
109
+ . filter_map ( |r| r)
110
+ . map ( String :: from)
111
+ . collect :: < Vec < _ > > ( ) ;
112
+
113
+ for remote in remotes {
114
+ fetch_from_remote (
115
+ repo_path,
116
+ & remote,
117
+ basic_credential. clone ( ) ,
118
+ None ,
119
+ ) ?;
120
+ }
121
+
122
+ Ok ( ( ) )
123
+ }
124
+
125
+ /// fetches from upstream/remote for local `branch`
101
126
pub ( crate ) fn fetch (
102
127
repo_path : & str ,
103
128
branch : & str ,
You can’t perform that action at this time.
0 commit comments