[cli] fix # 81

This commit is contained in:
yichuan520030910320
2025-09-01 16:53:09 -07:00
parent e6a542bf4b
commit 00c44e3980

View File

@@ -1073,7 +1073,9 @@ Examples:
try: try:
# Ensure both paths are resolved before computing relativity # Ensure both paths are resolved before computing relativity
file_path_resolved = file_path.resolve() file_path_resolved = file_path.resolve()
relative_path = file_path_resolved.relative_to(docs_path) # Determine directory scope using the non-resolved path to avoid
# misclassifying symlinked entries as outside the docs directory
relative_path = file_path.relative_to(docs_path)
if not include_hidden and _path_has_hidden_segment(relative_path): if not include_hidden and _path_has_hidden_segment(relative_path):
continue continue
# Use absolute path for gitignore matching # Use absolute path for gitignore matching