mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
fix: Handle tilde paths in cmd_drop for read-only files
This commit is contained in:
parent
00e4fdbb48
commit
bbd56d44e8
1 changed files with 6 additions and 3 deletions
|
@ -649,18 +649,21 @@ class Commands:
|
|||
|
||||
filenames = parse_quoted_filenames(args)
|
||||
for word in filenames:
|
||||
# Expand tilde in the path
|
||||
expanded_word = os.path.expanduser(word)
|
||||
|
||||
# Handle read-only files separately, without glob_filtered_to_repo
|
||||
read_only_matched = [f for f in self.coder.abs_read_only_fnames if word in f]
|
||||
read_only_matched = [f for f in self.coder.abs_read_only_fnames if expanded_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")
|
||||
|
||||
matched_files = self.glob_filtered_to_repo(word)
|
||||
matched_files = self.glob_filtered_to_repo(expanded_word)
|
||||
|
||||
if not matched_files:
|
||||
matched_files.append(word)
|
||||
matched_files.append(expanded_word)
|
||||
|
||||
for matched_file in matched_files:
|
||||
abs_fname = self.coder.abs_root_path(matched_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue