fix: Initialize abs_read_only_fnames set if it doesn't exist

This commit is contained in:
Paul Gauthier 2024-08-09 16:22:32 -03:00 committed by Paul Gauthier (aider)
parent e7cdd1d7b8
commit 77985f00cf

View file

@ -953,19 +953,9 @@ class Commands:
self.io.tool_error(f"Not a file: {abs_path}")
return
if not self.coder.abs_read_only_fnames:
self.coder.abs_read_only_fnames = set()
self.coder.abs_read_only_fnames.add(abs_path)
self.io.tool_output(f"Added {abs_path} to read-only files.")
content = self.io.read_text(abs_path)
if content is not None:
self.io.tool_output(f"Contents of {filename}:")
self.io.tool_output(content)
else:
self.io.tool_error(f"Unable to read {filename}")
def cmd_map(self, args):
"Print out the current repository map"
repo_map = self.coder.get_repo_map()