mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 20:54:59 +00:00
feat: Add git_ignored_file method to check files against gitignore
This commit is contained in:
parent
ea1a4ecdc6
commit
218623be28
3 changed files with 17 additions and 0 deletions
|
@ -737,6 +737,10 @@ class Commands:
|
|||
for matched_file in sorted(all_matched_files):
|
||||
abs_file_path = self.coder.abs_root_path(matched_file)
|
||||
|
||||
if self.coder.repo.git_ignored_file(matched_file):
|
||||
self.io.tool_error(f"Can't add {matched_file} which is in gitignore")
|
||||
continue
|
||||
|
||||
if not abs_file_path.startswith(self.coder.root) and not is_image_file(matched_file):
|
||||
self.io.tool_error(
|
||||
f"Can not add {abs_file_path}, which is not within {self.coder.root}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue