mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34: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
|
@ -355,6 +355,9 @@ class Coder:
|
|||
|
||||
for fname in fnames:
|
||||
fname = Path(fname)
|
||||
if self.repo and self.repo.git_ignored_file(fname):
|
||||
self.io.tool_warning(f"Skipping {fname} that matches gitignore spec.")
|
||||
|
||||
if self.repo and self.repo.ignored_file(fname):
|
||||
self.io.tool_warning(f"Skipping {fname} that matches aiderignore spec.")
|
||||
continue
|
||||
|
@ -1779,6 +1782,10 @@ class Coder:
|
|||
self.check_for_dirty_commit(path)
|
||||
return True
|
||||
|
||||
if self.repo and self.repo.git_ignored_file(path):
|
||||
self.io.tool_warning(f"Skipping edits to {path} that matches gitignore spec.")
|
||||
return
|
||||
|
||||
if not Path(full_path).exists():
|
||||
if not self.io.confirm_ask("Create new file?", subject=path):
|
||||
self.io.tool_output(f"Skipping edits to {path}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue