@@ -23,6 +23,7 @@ enum RepoKind {
23
23
fn find_git_repository_workdirs < P : Progress > (
24
24
root : impl AsRef < Path > ,
25
25
mut progress : P ,
26
+ debug : bool ,
26
27
) -> impl Iterator < Item = ( PathBuf , RepoKind ) >
27
28
where
28
29
<P as Progress >:: SubProgress : Sync ,
64
65
#[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
65
66
let walk = walk. parallelism ( jwalk:: Parallelism :: RayonNewPool ( 4 ) ) ;
66
67
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
+ }
68
72
let mut found_any_repo = false ;
69
73
let mut found_bare_repo = false ;
70
74
for entry in siblings. iter_mut ( ) . flatten ( ) {
74
78
entry. client_state = State { is_repo : true , is_bare } ;
75
79
entry. read_children_path = None ;
76
80
77
- found_any_repo = !is_bare ;
81
+ found_any_repo = true ;
78
82
found_bare_repo = is_bare;
79
83
}
80
84
}
@@ -212,11 +216,14 @@ pub fn discover<P: Progress>(
212
216
source_dir : impl AsRef < Path > ,
213
217
mut out : impl std:: io:: Write ,
214
218
mut progress : P ,
219
+ debug : bool ,
215
220
) -> anyhow:: Result < ( ) >
216
221
where
217
222
<<P as Progress >:: SubProgress as Progress >:: SubProgress : Sync ,
218
223
{
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
+ {
220
227
writeln ! ( & mut out, "{}" , git_workdir. display( ) ) ?;
221
228
}
222
229
Ok ( ( ) )
@@ -233,7 +240,9 @@ where
233
240
{
234
241
let mut num_errors = 0usize ;
235
242
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
+ {
237
246
if let Err ( err) = handle ( mode, kind, & path_to_move, & destination, & mut progress) {
238
247
progress. fail ( format ! (
239
248
"Error when handling directory {:?}: {}" ,
0 commit comments