File tree 3 files changed +10
-11
lines changed
3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -173,15 +173,14 @@ impl<'cb> RepoBuilder<'cb> {
173
173
174
174
/// Specify fetch depth, a value less than zero is interpreted as pull everything (effectively the same as no declaring a limit depth)
175
175
pub fn depth ( & mut self , depth : i32 ) -> & mut RepoBuilder < ' cb > {
176
- if !self . fetch_opts
177
- . as_mut ( )
178
- . is_some_and ( |fetch_opts| {
179
- fetch_opts. depth ( depth) ; true
180
- } ) {
181
- let mut fo = FetchOptions :: new ( ) ;
182
- fo. depth ( depth) ;
183
- self . fetch_options ( fo) ;
184
- }
176
+ if !self . fetch_opts . as_mut ( ) . is_some_and ( |fetch_opts| {
177
+ fetch_opts. depth ( depth) ;
178
+ true
179
+ } ) {
180
+ let mut fo = FetchOptions :: new ( ) ;
181
+ fo. depth ( depth) ;
182
+ self . fetch_options ( fo) ;
183
+ }
185
184
186
185
self
187
186
// if let Some(ref fetch_opts) = &self.fetch_opts {
Original file line number Diff line number Diff line change @@ -510,7 +510,7 @@ impl<'cb> FetchOptions<'cb> {
510
510
follow_redirects : RemoteRedirect :: Initial ,
511
511
custom_headers : Vec :: new ( ) ,
512
512
custom_headers_ptrs : Vec :: new ( ) ,
513
- depth : 0 // Not limited depth
513
+ depth : 0 , // Not limited depth
514
514
}
515
515
}
516
516
Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ impl Repository {
342
342
}
343
343
344
344
/// Clone a remote repository with a depth of one (shallow cloning)
345
- ///
345
+ ///
346
346
/// Similar to `git clone --depth 1`
347
347
pub fn shallow_clone < P : AsRef < Path > > ( url : & str , into : P ) -> Result < Repository , Error > {
348
348
RepoBuilder :: new ( ) . depth ( 1 ) . clone ( url, into. as_ref ( ) )
You can’t perform that action at this time.
0 commit comments