@@ -43,6 +43,7 @@ use function_grep::{
43
43
} ;
44
44
use git_function_history_proc_macro:: enumstuff;
45
45
46
+ use log:: { info, warn} ;
46
47
#[ cfg( feature = "parallel" ) ]
47
48
use rayon:: prelude:: { IntoParallelIterator , ParallelIterator } ;
48
49
@@ -337,7 +338,7 @@ fn traverse_tree(
337
338
langs : & [ & InstatiatedLanguage < ' _ > ] ,
338
339
filetype : & FileFilterType ,
339
340
) -> Result < Vec < ParsedFile > , String > {
340
- let mut files_exts = file_exts. iter ( ) ;
341
+ let mut files_exts_iter = file_exts. iter ( ) ;
341
342
let treee_iter = tree. iter ( ) ;
342
343
let mut files: Vec < _ > = Vec :: new ( ) ;
343
344
let mut ret = Vec :: new ( ) ;
@@ -364,32 +365,45 @@ fn traverse_tree(
364
365
match & filetype {
365
366
FileFilterType :: Relative ( ref path) => {
366
367
if !file. ends_with ( path) {
368
+ info ! ( "{file} was skipped because it was not in path {path}" ) ;
367
369
continue ;
368
370
}
369
371
}
370
372
FileFilterType :: Absolute ( ref path) => {
371
373
if & file != path {
374
+ info ! ( "{file} was skipped because it was not the same as path {path}" ) ;
372
375
continue ;
373
376
}
374
377
}
375
378
FileFilterType :: Directory ( ref path) => {
376
379
if !file. contains ( path) {
380
+ info ! ( "{file} was skipped because it was not in dir {path}" ) ;
377
381
continue ;
378
382
}
379
383
}
380
384
FileFilterType :: None => { }
381
385
}
382
386
383
- if !files_exts. any ( |ext| ends_with_cmp_no_case ( & file, ext) ) {
387
+ // we have to clone because any abosrbs elements
388
+ // TODO: better solution then clone each time
389
+ if !files_exts_iter
390
+ . clone ( )
391
+ . any ( |ext| ends_with_cmp_no_case ( & file, ext) )
392
+ {
393
+ info ! (
394
+ "{file} was skipped because it was not supported supported {file_exts:?}"
395
+ ) ;
384
396
continue ;
385
397
}
386
398
387
399
let obh = repo
388
400
. find_object ( i. oid ( ) )
389
- . map_err ( |_| "failed to find object" ) ?;
401
+ . map_err ( |e| format ! ( "failed to find object for file {file}: {e}" ) )
402
+ . inspect_err ( |e| warn ! ( "{e}" ) ) ?;
390
403
let blob = obh
391
404
. try_into_blob ( )
392
- . map_err ( |e| format ! ( "could not obtain file contents of {file}: {e}" ) ) ?;
405
+ . map_err ( |e| format ! ( "could not obtain file contents of {file}: {e}" ) )
406
+ . inspect_err ( |e| warn ! ( "{e}" ) ) ?;
393
407
files. push ( ( file, String :: from_utf8_lossy ( & blob. data ) . to_string ( ) ) ) ;
394
408
}
395
409
_ => { }
0 commit comments