File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -477,6 +477,10 @@ class GitDataCollector(DataCollector):
477477 except ValueError :
478478 print 'Warning: failed to parse line "%s"' % line
479479
480+
481+ # compile exclude_paths regex
482+ conf ['exclude_paths' ] = [re .compile (pattern , re .IGNORECASE ) for pattern in conf ['exclude_paths' ]]
483+
480484 # extensions and size of files
481485 lines = getpipeoutput (['git ls-tree -r -l -z %s' % getcommitrange ('HEAD' , end_only = True )]).split ('\000 ' )
482486 blobs_to_read = []
@@ -492,11 +496,12 @@ class GitDataCollector(DataCollector):
492496 fullpath = parts [4 ]
493497
494498 exclude = False
495- for path in conf ['exclude_paths' ]:
496- if path in fullpath :
499+ for pattern in conf ['exclude_paths' ]:
500+ if pattern . search ( fullpath ) :
497501 exclude = True
498502 break
499503 if exclude :
504+ print 'Excluding file: %s' % fullpath
500505 continue
501506
502507 self .total_size += size
You can’t perform that action at this time.
0 commit comments