From 64a59f956024efc879c9d575889e021313686c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Inez?= <39469255+joaoinez@users.noreply.github.com> Date: Thu, 27 Feb 2025 04:46:03 +0100 Subject: [PATCH] fix(rag_service): ignore leading slash gitignore patterns (#1412) --- py/rag-service/src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/rag-service/src/main.py b/py/rag-service/src/main.py index 9e52e6f..1050c06 100644 --- a/py/rag-service/src/main.py +++ b/py/rag-service/src/main.py @@ -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