mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
fix: Handle read-only files separately in cmd_drop
This commit is contained in:
parent
39fffd81d5
commit
e42a7caf1b
1 changed files with 8 additions and 3 deletions
|
@ -609,6 +609,14 @@ class Commands:
|
||||||
|
|
||||||
filenames = parse_quoted_filenames(args)
|
filenames = parse_quoted_filenames(args)
|
||||||
for word in filenames:
|
for word in filenames:
|
||||||
|
# Handle read-only files separately
|
||||||
|
read_only_matched = [f for f in self.coder.abs_read_only_fnames if word in f]
|
||||||
|
if read_only_matched:
|
||||||
|
for matched_file in read_only_matched:
|
||||||
|
self.coder.abs_read_only_fnames.remove(matched_file)
|
||||||
|
self.io.tool_output(f"Removed read-only file {matched_file} from the chat")
|
||||||
|
continue
|
||||||
|
|
||||||
matched_files = self.glob_filtered_to_repo(word)
|
matched_files = self.glob_filtered_to_repo(word)
|
||||||
|
|
||||||
if not matched_files:
|
if not matched_files:
|
||||||
|
@ -619,9 +627,6 @@ class Commands:
|
||||||
if abs_fname in self.coder.abs_fnames:
|
if abs_fname in self.coder.abs_fnames:
|
||||||
self.coder.abs_fnames.remove(abs_fname)
|
self.coder.abs_fnames.remove(abs_fname)
|
||||||
self.io.tool_output(f"Removed {matched_file} from the chat")
|
self.io.tool_output(f"Removed {matched_file} from the chat")
|
||||||
elif abs_fname in self.coder.abs_read_only_fnames:
|
|
||||||
self.coder.abs_read_only_fnames.remove(abs_fname)
|
|
||||||
self.io.tool_output(f"Removed read-only file {matched_file} from the chat")
|
|
||||||
|
|
||||||
def cmd_git(self, args):
|
def cmd_git(self, args):
|
||||||
"Run a git command"
|
"Run a git command"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue