Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit 2e93c98

Browse files
authored
Cache hidden dir bug (#63)
* fix path basename lookup * add ignore_hidden arg to recursive _dirhash
1 parent a76236a commit 2e93c98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,15 @@ def _dirhash(self, directory, hash, ignore_hidden=False, excluded_extensions=[])
379379
assert Path(directory).is_dir()
380380
for path in sorted(Path(directory).iterdir(), key=lambda p: str(p).lower()):
381381
if path.is_file():
382-
if not ignore_hidden and path.basename().startswith("."):
382+
if not ignore_hidden and path.name.startswith("."):
383383
continue
384384
if path.suffix in excluded_extensions:
385385
continue
386386
with open(path, "rb") as f:
387387
for chunk in iter(lambda: f.read(4096), b""):
388388
hash.update(chunk)
389389
elif path.is_dir():
390-
hash = self._dirhash(path, hash)
390+
hash = self._dirhash(path, hash, ignore_hidden=ignore_hidden)
391391
return hash
392392

393393
def _cache(func):

0 commit comments

Comments
 (0)