File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -105,13 +105,15 @@ impl PrepareFetch {
105
105
. unwrap_or_else ( || "origin" . into ( ) ) ,
106
106
} ;
107
107
108
- let mut remote = repo
109
- . remote_at ( self . url . clone ( ) ) ?
110
- . with_refspecs (
111
- Some ( format ! ( "+refs/heads/*:refs/remotes/{remote_name}/*" ) . as_str ( ) ) ,
112
- remote:: Direction :: Fetch ,
113
- )
114
- . expect ( "valid static spec" ) ;
108
+ let mut remote = repo. remote_at ( self . url . clone ( ) ) ?;
109
+ if remote. fetch_specs . is_empty ( ) {
110
+ remote = remote
111
+ . with_refspecs (
112
+ Some ( format ! ( "+refs/heads/*:refs/remotes/{remote_name}/*" ) . as_str ( ) ) ,
113
+ remote:: Direction :: Fetch ,
114
+ )
115
+ . expect ( "valid static spec" ) ;
116
+ }
115
117
let mut clone_fetch_tags = None ;
116
118
if let Some ( f) = self . configure_remote . as_mut ( ) {
117
119
remote = f ( remote) . map_err ( Error :: RemoteConfiguration ) ?;
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ where
182
182
progress : impl Progress ,
183
183
options : ref_map:: Options ,
184
184
) -> Result < Prepare < ' remote , ' repo , T > , prepare:: Error > {
185
- if self . remote . refspecs ( remote:: Direction :: Fetch ) . is_empty ( ) {
185
+ if self . remote . refspecs ( remote:: Direction :: Fetch ) . is_empty ( ) && options . extra_refspecs . is_empty ( ) {
186
186
return Err ( prepare:: Error :: MissingRefSpecs ) ;
187
187
}
188
188
let ref_map = self . ref_map_inner ( progress, options) . await ?;
You can’t perform that action at this time.
0 commit comments