@@ -379,8 +379,8 @@ def add_directory(
379
379
base_path = path
380
380
if into_path is None :
381
381
into_path = path
382
- if self ._collect_ignores and path in self .ignored_dirs :
383
- self .ignored_dirs .remove (path )
382
+ if self ._collect_ignores and relpath ( path , base_path ) in self .ignored_dirs :
383
+ self .ignored_dirs .remove (relpath ( path , base_path ) )
384
384
if exclude_paths :
385
385
self .add_ignore_patterns (
386
386
path , base_path , [join (e , "*" ) for e in exclude_paths ])
@@ -392,7 +392,7 @@ def add_directory(
392
392
self ._ignoreset .add_mbedignore (
393
393
real_base , join (root , IGNORE_FILENAME ))
394
394
395
- root_path = join (relpath (root , base_path ))
395
+ root_path = join (relpath (root , base_path ))
396
396
if self ._ignoreset .is_ignored (join (root_path ,"" )):
397
397
self .ignore_dir (root_path )
398
398
dirs [:] = []
@@ -407,11 +407,11 @@ def add_directory(
407
407
if (any (self ._not_current_label (d , t ) for t
408
408
in self ._labels .keys ())):
409
409
self ._label_paths .append ((dir_path , base_path , into_path ))
410
- self .ignore_dir (dir_path )
410
+ self .ignore_dir (relpath ( dir_path , base_path ) )
411
411
dirs .remove (d )
412
412
elif (d .startswith ('.' ) or d in self ._legacy_ignore_dirs or
413
413
self ._ignoreset .is_ignored (join (root_path , d , "" ))):
414
- self .ignore_dir (dir_path )
414
+ self .ignore_dir (relpath ( dir_path , base_path ) )
415
415
dirs .remove (d )
416
416
417
417
# Add root to include paths
0 commit comments