mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +00:00
fix: handle non-existent files in EditBlockCoder #2233
This commit is contained in:
parent
96ad107c19
commit
966a613ffe
1 changed files with 6 additions and 2 deletions
|
@ -46,8 +46,12 @@ class EditBlockCoder(Coder):
|
|||
for edit in edits:
|
||||
path, original, updated = edit
|
||||
full_path = self.abs_root_path(path)
|
||||
content = self.io.read_text(full_path)
|
||||
new_content = do_replace(full_path, content, original, updated, self.fence)
|
||||
new_content = None
|
||||
|
||||
if Path(full_path).exists():
|
||||
content = self.io.read_text(full_path)
|
||||
new_content = do_replace(full_path, content, original, updated, self.fence)
|
||||
|
||||
if not new_content:
|
||||
# try patching any of the other files in the chat
|
||||
for full_path in self.abs_fnames:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue