diff --git a/server.py b/server.py index 2d05b28..5c2f00a 100644 --- a/server.py +++ b/server.py @@ -201,6 +201,15 @@ def list_vault( continue if entry.name in OBSIDIAN_HIDDEN and not str(entry.resolve()).startswith(str(vault / ".obsidian")): continue + # Also skip entries nested inside any hidden/excluded directory ancestor + # (e.g. .git/objects/ab/cdef — the file name looks innocent but it lives + # under .git, which rglob walks into before we can stop it) + rel = entry.relative_to(vault) + if any( + part.startswith(".") and part != ".obsidian" + for part in rel.parts + ): + continue info = _file_info(entry, vault) if entry.is_dir():