Skip to content

Commit fab0ef2

Browse files
committed
squash: address comments
1 parent da58170 commit fab0ef2

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

tests/unit/test_filesystem.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def fixture_copy_tree_paths_git(copy_tree_paths: CopyTreePathConfig) -> CopyTree
7878

7979
(source_dir / 'subdir' / '.gitignore').write_text('*.ignore-me\n')
8080

81+
(source_dir / 'subdir' / '.git').mkdir(parents=True)
82+
8183
return source_dir, dest_dir, symlinks_supported
8284

8385

@@ -436,6 +438,7 @@ def test_copy_exclude_gitignore(
436438
assert (dest_dir / '.git').exists() is True
437439
assert (dest_dir / 'this-file-is-apparently-ignored.ignore-me').exists() is True
438440
assert (dest_dir / 'subdir' / 'this-file-is-also-ignored.ignore-me').exists() is False
441+
assert (dest_dir / 'subdir' / '.git').exists() is True
439442

440443

441444
@pytest.mark.parametrize(
@@ -475,4 +478,6 @@ def test_copy_exclude_dot_git(
475478
return
476479

477480
assert (source_dir / '.git').exists() is True
481+
assert (source_dir / 'subdir' / '.git').exists() is True
478482
assert (dest_dir / '.git').exists() is False
483+
assert (dest_dir / 'subdir' / '.git').exists() is True

tmt/utils/filesystem.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ def _ignore(path: str, entries: list[str]) -> set[str]:
235235
entry
236236
for entry in entries
237237
if str(current_dirpath_relative / entry).rstrip('/') in exclude_paths
238-
or entry.rstrip('/') in exclude_paths
239238
}
240239

241240
_copytree(ignore=_ignore)

0 commit comments

Comments
 (0)