fix(rag_service): ignore leading slash gitignore patterns (#1412)

This commit is contained in:
João Inez
2025-02-27 04:46:03 +01:00
committed by GitHub
parent 81067b31aa
commit 64a59f9560

View File

@@ -528,7 +528,7 @@ def scan_directory(directory: Path) -> list[str]:
if not spec:
matched_files.extend(file_paths)
continue
matched_files.extend([file for file in file_paths if not spec.match_file(file)])
matched_files.extend([file for file in file_paths if not spec.match_file(os.path.relpath(file, directory))])
return matched_files