File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -105,13 +105,15 @@ impl PrepareFetch {
105105 . unwrap_or_else ( || "origin" . into ( ) ) ,
106106 } ;
107107
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+ }
115117 let mut clone_fetch_tags = None ;
116118 if let Some ( f) = self . configure_remote . as_mut ( ) {
117119 remote = f ( remote) . map_err ( Error :: RemoteConfiguration ) ?;
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ where
182182 progress : impl Progress ,
183183 options : ref_map:: Options ,
184184 ) -> 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 ( ) {
186186 return Err ( prepare:: Error :: MissingRefSpecs ) ;
187187 }
188188 let ref_map = self . ref_map_inner ( progress, options) . await ?;
You can’t perform that action at this time.
0 commit comments