mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
fixed regression allowing non-repo files to move from /read to /add
This commit is contained in:
parent
ffd7364410
commit
817530ccb7
1 changed files with 10 additions and 5 deletions
|
@ -711,11 +711,16 @@ class Commands:
|
||||||
self.io.tool_error(f"{matched_file} is already in the chat as an editable file")
|
self.io.tool_error(f"{matched_file} is already in the chat as an editable file")
|
||||||
continue
|
continue
|
||||||
elif abs_file_path in self.coder.abs_read_only_fnames:
|
elif abs_file_path in self.coder.abs_read_only_fnames:
|
||||||
self.coder.abs_read_only_fnames.remove(abs_file_path)
|
if self.coder.repo and self.coder.repo.path_in_repo(matched_file):
|
||||||
self.coder.abs_fnames.add(abs_file_path)
|
self.coder.abs_read_only_fnames.remove(abs_file_path)
|
||||||
self.io.tool_output(
|
self.coder.abs_fnames.add(abs_file_path)
|
||||||
f"Moved {matched_file} from read-only to editable files in the chat"
|
self.io.tool_output(
|
||||||
)
|
f"Moved {matched_file} from read-only to editable files in the chat"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.io.tool_error(
|
||||||
|
f"Cannot add {matched_file} as it's not part of the repository"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
if is_image_file(matched_file) and not self.coder.main_model.accepts_images:
|
if is_image_file(matched_file) and not self.coder.main_model.accepts_images:
|
||||||
self.io.tool_error(
|
self.io.tool_error(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue