@@ -23,6 +23,7 @@ enum RepoKind {
2323fn find_git_repository_workdirs < P : Progress > (
2424 root : impl AsRef < Path > ,
2525 mut progress : P ,
26+ debug : bool ,
2627) -> impl Iterator < Item = ( PathBuf , RepoKind ) >
2728where
2829 <P as Progress >:: SubProgress : Sync ,
6465 #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
6566 let walk = walk. parallelism ( jwalk:: Parallelism :: RayonNewPool ( 4 ) ) ;
6667
67- walk. process_read_dir ( move |_depth, _path, _read_dir_state, siblings| {
68+ walk. process_read_dir ( move |_depth, path, _read_dir_state, siblings| {
69+ if debug {
70+ eprintln ! ( "{}" , path. display( ) ) ;
71+ }
6872 let mut found_any_repo = false ;
6973 let mut found_bare_repo = false ;
7074 for entry in siblings. iter_mut ( ) . flatten ( ) {
7478 entry. client_state = State { is_repo : true , is_bare } ;
7579 entry. read_children_path = None ;
7680
77- found_any_repo = !is_bare ;
81+ found_any_repo = true ;
7882 found_bare_repo = is_bare;
7983 }
8084 }
@@ -212,11 +216,14 @@ pub fn discover<P: Progress>(
212216 source_dir : impl AsRef < Path > ,
213217 mut out : impl std:: io:: Write ,
214218 mut progress : P ,
219+ debug : bool ,
215220) -> anyhow:: Result < ( ) >
216221where
217222 <<P as Progress >:: SubProgress as Progress >:: SubProgress : Sync ,
218223{
219- for ( git_workdir, _kind) in find_git_repository_workdirs ( source_dir, progress. add_child ( "Searching repositories" ) ) {
224+ for ( git_workdir, _kind) in
225+ find_git_repository_workdirs ( source_dir, progress. add_child ( "Searching repositories" ) , debug)
226+ {
220227 writeln ! ( & mut out, "{}" , git_workdir. display( ) ) ?;
221228 }
222229 Ok ( ( ) )
@@ -233,7 +240,9 @@ where
233240{
234241 let mut num_errors = 0usize ;
235242 let destination = destination. as_ref ( ) . canonicalize ( ) ?;
236- for ( path_to_move, kind) in find_git_repository_workdirs ( source_dir, progress. add_child ( "Searching repositories" ) ) {
243+ for ( path_to_move, kind) in
244+ find_git_repository_workdirs ( source_dir, progress. add_child ( "Searching repositories" ) , false )
245+ {
237246 if let Err ( err) = handle ( mode, kind, & path_to_move, & destination, & mut progress) {
238247 progress. fail ( format ! (
239248 "Error when handling directory {:?}: {}" ,
0 commit comments